I want to make it so that when a new game starts 15 seconds in a person will be randomly selected to be it which will make them be on the orange team. Very much like a hide and seek script. Here's the script.
function FirstInfected() Wait(15) players=game.Players:GetPlayers() while player==1 do first_infected=players[math.random(1, #players)] first_infected.TeamColor=Brick.new("Bright orange") end end FirstInfected()
Thanks
function FirstInfected() wait(15) --Lua is case sensitive, so Wait is not recognized, lowercase it. players=game.Players:GetPlayers() while player==1 do --Could you explain this line? I am confused on when player came from, and why you just want one. first_infected=players[math.random(1, #players)] first_infected.TeamColor=BrickColor.new("Bright orange") --It's BrickColor, not Brick. Brick I don't even know what that is. end end FirstInfected() --Alright, it executes the script.
If you could just explain line four for me, I could probably help you out further.