How do I use /testfor to detect a kill with the objectives?
So in my new server I just added a PvP area, and I ran into a problem: I can't figure out how to give a player money for killing someone.
Here's my current set up: What I have is an objective that detects player kills with a command block on a Redstone clock.
The clock has the following code inside: /testfor @a[score_killreward_min=1]
. Afterwards (this is the command I need) I need another command which is supposed to pay that player for killing someone. Lastly, I just have a command that sets the score back to 0. /scoreboard players set @a killreward 0
.
Solution 1:
I found out the solution. I needed a command block in the middle with the following command:
/eco give @a[score_killreward_min=1]
I put a delay for the redstone current afterwards to set it to 0.