of     1   

teamkilled
#138871512Tuesday, July 01, 2014 4:49 PM GMT

I made this script, but sometimes it will change the person's value inside of them to either killer or survivor even after they have already had their value changed. The original value is "human", and I was wondering if there was an easy way that I could make the part of the script that chooses the killers and the survivors only choose people who have not already had their value changed and are not the god. local players = game.Players:GetChildren() local picked = players[math.random(1, #players)] print(picked.Name) picked.animal.Value = "god" --makes one person the "god" in the server local playersremaining = game.Players.NumPlayers - 1 for i = 1, playersremaining do local players = game.Players:GetChildren() local picked = players[math.random(1, #players)] print(picked.Name) picked.animal.Value = "killer" local players = game.Players:GetChildren() local picked = players[math.random(1, #players)] print(picked.Name) picked.animal.Value = "survivor" end
JarodOfOrbiter
#138872810Tuesday, July 01, 2014 5:03 PM GMT

Put their names into a table to check so they don't get picked again. Also, I notice you GetChildren each time. Don't do that, as there are no waits. Only GetChildren once, and chances are very high that everyone will be included.
TechSpectrum
#138873207Tuesday, July 01, 2014 5:07 PM GMT

Make a value like LastPlayer = "UserNameHere" then have it check if the name matches, if it does, it repeats the random selection.
smiley599
#138874156Tuesday, July 01, 2014 5:17 PM GMT

Make a table with all players then use table.remove and re do it.

    of     1