I am taking a unique approach to the voting system idea by giving each person a unique identifier that you can look at in the leaderboard. The problem is, that the Item Granter seems to be giving each player the same amount of the item.
(picture at bottom)
As you can see, I have a Lifecycle wired to a Relay that loops through all the players. The trigger increments the counter by 1, which also changes a property value that the Item Granter can access.
(The reason why I am using a trigger to increment the counter is because the Counter only has a “Target Value Reached” out condition)
From the Trigger, I run the Wire Pulse Block. Here is the code below:
Hold on, the reason it is giving people the same amount is because there is nothing that changes it based on who you are. The only way to do that is if it is a free for all.
The way I would set this up would be to have a player counter made, and store the number of players in a property C. Then have a relay (run when receiving on wire AND when receiving on channel S) pick a random player, and trigger an item granters code. It needs to first, increment property Y by one, grant them property Y items, and check if Y = C. If false, have the block transmit on channel S.
Because I’m not in your head, I don’t know what you would name the channels. So I use placeholder names instead. They still work as channel names, but I don’t recommend it due to the names not showing what they do.