The problem I'm having is that whenever I set the players team to white, it doesn't set it. Help is needed D:
time = 0 -- For safety concerns
while true do -- Loop timer so it works
time = time + 1
print(time)
function kill() -- Kill all players
playerNames = game.Players:GetChildren()--Find the names of all the players
for i = 1, #playerNames do ----repeat until all the players are killed
game.Workspace[playerNames[i].Name].Humanoid.Health = 0 ----kill the player
end ----finished
end -- Ends the kill() function
if time >= 30 then --Time for people to choose character
kill() -- Runs the kill() function
wait(20) --The game runs
--RIGHT HERE
playerNames = game.Players:GetChildren() ----Find the names of all the players
playerNames.TeamColor = BrickColor.new("White") -- Sets all player's team to spectator
kill() -- Runs the kill() function
--RIGHT HERE
time = 0 -- Resets the timer
end -- Ends the "if" statement
print(time) -- for debugging
wait(0.9) -- Wait 1 second so it doesn't keep looping at hyperspeed until the game crashes
end -- Ends the loop

2 comments
you forgot a DO but other than that i think it will work
Oh, thank you for that, you see I am on iPad and I must have missed that.