Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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
0
All of it works besides the last line (line 3) SlaPP_YT 4 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

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.

0
Oh! Thanks so much! SlaPP_YT 4 — 5y
Ad

Answer this question