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

Why is this basic code not working, trying to make walkspeed 0?

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		local humanoid = char:WaitForChild("Humanoid")
		humanoid.WalkSpeed = 0
	end)
	
end)

How does something as simple as this not work??? Am I missing something

6 comments

0

What's the error?

0

what's not working? you're still able to move?

0

Add a wait(3) or wait(2) after “player.CharacterAdded:Connect(function()” for the character to load in. This isn’t the most efficient.

0

You could try to use “CharacterAdded:Wait()”

0

There's no error. Yh I tried wait(3), that doesn't work. Neither does CharacterAdded:Wait(). I don't get why it's not working?

0

Where have you put the script, I highly recommend putting scripts like these inside either Workspace or ServerScriptService since scripts won't work if you put them in wrong places.

1 answer

✓ Accepted answer

There is nothing wrong with it, did you put it in a server script in serverscriptservice?

Also 0 means you can't move if you didn't know.

1 comment

0

0 iq me put it in serverstorage and thought it was serverscriptservice LOL

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