Convert player kill count in money [Vanilla]
With /scoreboard objectives add killCount playerKillCount Kills I can make a Kill Counter, but I want to convert the kill point in a in-game vanilla currency that I created with /scoreboard objectives add Money dummy Money. How can I add money just for the killer and not for every person online on the server? I'm using scoreboards for the first time and I'm a bit confused.. The scoreboard is player-related or keeps track of every player online in a unique scoreboard?
Best Answer
With Scoreboard operations you can set/change the value of one players scoreboard to another player's (May be the same) score in another objective (may be the same objective). The scoreboard is univeresal, in the scoreboard there are objectives, which are sub divisions of the scoreboard. In each objective each player can have a score, the score of the player exists only in that objective and MAY be different in other objectives.
The solution: Every tick add the player's kill count to his money and reset his kill count
Setup:
/scoreboard objectives add killCount playerKillCount
/scoreboard objectives add multiplier dummy
/scoreboard objectives add money dummy
Clock(20 tick):
/scoreboard players set @a multiplier <How Much money per kill>
/execute @a ~ ~ ~ scoreboard players operation @p[r=0] killCount *= @p multiplier
/execute @a ~ ~ ~ scoreboard players operation @p[r=0] money += @p killCount
/scoreboard players set @a killCount = 0;
- Set their multiplier
- Multiply their killCount by the multiplier
- Add their killCount(Now in terms of money) to their money
- Reset their killCount
Pictures about "Convert player kill count in money [Vanilla]"
![Convert player kill count in money [Vanilla] - From above electronic calculator and notepad placed over United States dollar bills together with metallic pen for budget planning and calculation Convert player kill count in money [Vanilla] - From above electronic calculator and notepad placed over United States dollar bills together with metallic pen for budget planning and calculation](/assets/images/convert_player_kill_count_in_money_vanilla_1.jpeg)
![Convert player kill count in money [Vanilla] - Crop man counting dollar banknotes Convert player kill count in money [Vanilla] - Crop man counting dollar banknotes](/assets/images/convert_player_kill_count_in_money_vanilla_2.jpeg)
![Convert player kill count in money [Vanilla] - Crop anonymous financier planning budget writing numbers in notebook Convert player kill count in money [Vanilla] - Crop anonymous financier planning budget writing numbers in notebook](/assets/images/convert_player_kill_count_in_money_vanilla_3.jpeg)
How do you make a kill counter scoreboard?
Scoreboard CommandMinecraft 1.16 Kill Reward System // Command Block Tutorial
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Alexander Mils, Karolina Grabowska, Karolina Grabowska, Karolina Grabowska
