How do you give just half of the player in a game an item

I need help. How do you give half of the players in a game an item

  1. It has to happen at the press of the button
  2. It has to be even

Wait, what items are players going to get?
Because they can’t get half of a gadget.

Half of the players in the game get an not players get half and item

2 Likes

Are the players on teams?

2 Likes

The mean half of the players.
ex:
10 players, 5 of them get the evil eye and etc.

You’ll probably need to create a player counter. Why exactly do you need this mechanic in game? There might be an easier way to do it if I know the reasoning.

(Gimkit_kid I didn’t mean to reply to you, my fault)

1 Like

First, make a live player counter if you don’t have one already. Second, place down a button. The button should be wired to an all players relay, which should be wired to a checker,[1] which should be wired to a counter linked to a property.[2] Next, wire the same button to a trigger. This trigger needs to have block code checking:(if players in game is odd, then players with item need to be equal to (P.I.G.-1)/2; if P.I.G. is even, then players with item need to be equal to (P.I.G.)/2). If the code passes, do nothing.[3] If the code fails, broadcast on a channel. [4] That channel should broadcast to a separate, random player relay. Wire the second relay to a checker. It should check if the amount of item is greater than 0. If it’s true, trigger the first relay again. If it’s false, grant that player the item and then trigger the first relay again. [5] If any part of this doesn’t work, just let me know!


  1. this checker needs to check if the number of items the player has is greater than 0. ↩︎

  2. this is a number property that holds the number of people in the game with that item. ↩︎

  3. you could broadcast on a channel to a notification so you know that the process is done here. ↩︎

  4. I’ll call it CodeFails. ↩︎

  5. Since the first week of my GKC experience, I always wanted to build something like this. My version would have been a Thanos snap though. ↩︎

3 Likes

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.