Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I make it so that I can set one person's walkspeed to zero?

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

0

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

1 answer

✓ Accepted answer

You need to get the Character of the player to access the humanoid.

randomPlayer.Character.Humanoid.WalkSpeed = 0

The Character is the Server Side of the player while the Player is the Client side.

1 comment

0

Oh! Thanks so much!

This discussion is preserved as it was. New answers, comments, and votes are closed.