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 |