I am making a hide and seek game and I got stuck on a specific part of my script. I am trying to make it so that whoever the player that is on the "IT" team is (which is the Maroon team) can't walk around until all the players have hidden, which they have 60 seconds to do. I am trying to do this by changing the randomly selected player's walk speed to zero, and then when the timer runs out, setting it back to normal. Here is what I am currently trying and I don't know what I am doing wrong since I am still kind of a noob at scripting.
local randomPlayer = game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())]
randomPlayer.TeamColor = BrickColor.new("Maroon")
randomPlayer.Humanoid.WalkSpeed = 0

1 comment
All of it works besides the last line (line 3)