How do I change player walkspeed through script?

image
My script above wont work. How do I change a players walkspeed through script?

2 Likes

Don’t put player:WaitForChild("Character")
Put this instead

local char = player.Character or player.CharacterAdded:Wait()
1 Like

To add on to what he said, the problem isn’t that you need to wait for the character, rather that you need to wait for its instances to all load. And that is how. After that you actually don’t need to wait for hum.

tysm. Do you know how I could do this script with jump also? I dont want the player to be able to jump.

Change the humanoid JumpPower property to 0

Try making a script in serverScriptStorage and put this:

game.Players.PlayerAdded:Connect(function(plr)
         plr.CharacterAdded:Connect(function(character)
                    character:WaitForChild("Humanoid").WalkSpeed = 0

end)

Humanoids replicate to server so this is actually useless and slows down the server