Hi! So, I am making a game where 1 player gets chosen to be IT. I have no clue how to do that so some help will be great! Thanks - Cheers
Assuming you've added the players in the game to a arraylist or map. You would do something like this(Answered this question today) Code (Text): int selecting = new Random().nextInt(map.size()); Object picked = map.get(selecting); For a map you'd probably have to loop through it and get one
Sorry - How would I target someone ONLY if they have something true? For example: set {playerTarget} to a random player out of all players that have {playing.%player%} to true - Thanks for the help
try: Code (code (Unknown Language)): loop all players: if {target.%loop-player%} is true: set {target} to loop-player stop
You need a list variable to use the random feature. Code (Text): loop all players: if {playing.%player%} is true: add loop-player to {_playing::*} set {playerTarget} to a random player out of {_playing::*}
It should be like this Code (Text): loop all players: if {playing.%loop-player%} is true: add loop-player to {_playing::*} set {playerTarget} to a random player out of {_playing::*}