-2

I am working on a server and trying to make a command block that detects your kills (and if possible your Kill/Death Ratio).

Once you get 10 kills (and if possible a 25%+ K/D Ratio), You rank up to the next arena that has different kill and (if possible K/D Ratio) requirements. I'm looking for someone that can basically show me how to do this with command blocks, because all of the plugins I have tried don't do what I'm asking. If anyone can help me out I would gladly appreciate it.

5
  • 1
    How much knowledge of commands do you have? What part of this do you especially need help with? Commented Aug 11, 2017 at 15:58
  • Well, all I know is to create an objective and set the players score... I need help with all of it basically. Commented Aug 11, 2017 at 16:03
  • 3
    What have you tried already? This question might attract downvotes just because you didn't show your efforts and the answer is somewhat easily googleable. Commented Aug 11, 2017 at 16:33
  • I have created the objectives and tried to detect how much kills a player has had but had no luck. I have tried google before this and no luck. Commented Aug 11, 2017 at 16:50
  • This is a question that should have had more research before being asked.
    – Galen Nare
    Commented Aug 12, 2017 at 22:14

1 Answer 1

3

Set up four objectives:

/scoreboard objectives add deaths deathCount Deaths
/scoreboard objectives add kills playerKillCount Kills
                                 ^ OR totalKillCount if you want mob kills to count
/scoreboard objectives add kdr dummy Kill Death Ratio
/scoreboard objectives add arena dummy Arena

Also set up this score beforehand:

/scoreboard players set #1000 kdr 1000

And make sure every player in the first arena has arena = 1.

Now, run these commands on a loop:

execute @a ~ ~ ~ scoreboard players operation @s kdr = @s kills
scoreboard players operation @a kdr *= #1000 kdr
execute @a ~ ~ ~ scoreboard players operation @s kdr /= @s deaths

# Now every players' kdr score stores their kill-death-ratio,
# times 1000 so that we don't lose the fraction.

say Moving on to Arena 2: @a[score_arena_min=1,score_arena=1,score_kdr_min=250,score_kills_min=10]
scoreboard players set @a[score_arena_min=1,score_arena=1,score_kdr_min=250,score_kills_min=10] arena 2

And do whatever teleporting you need.

1
  • You are a life saver, my friend. Thank you so much Commented Aug 11, 2017 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.