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

How do i make all players Walkspeed 35?

Asked by 9 years ago

I used to have a way to triple the Walkspeed, witch i think is 15, but i don't know how to make it exactly 35. I am making a map for "Sprint Racing" by Rukiryo, and to test it i need my speed to be 35. This seems like a simple script, but i'm not that good :/

2 answers

Log in to vote
1
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

Default WalkSpeed is 16. If you want to change the default WalkSpeed to 35 then change it whenever a character spawns:

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        character:WaitForChild("Humanoid").WalkSpeed=35
    end)
end)
Ad
Log in to vote
0
Answered by
Mokiros 135
9 years ago

To change player walkspeed, we need to find player's Humanoid. The first thing we need to do is find LocalPlayer, then find his character in Workspace, and then find Humanoid. To find player's model in workspace, we can use Character. And finally, to find Humanoid, we can use :FindFirstChild(), and after finding humanoid, change his walkspeed.

Notice that it must be LocalScript putted either into StarterGUI or into StarterPlayer > StarterPlayerScripts

Here is the code:

Player = game:GetService("Players").LocalPlayer --Finding our player

Character = Player.Character --Finding player's model in Workspace

Humanoid = Character:FindFirstChild("Humanoid") --Finding Humanoid

Humanoid.WalkSpeed = 35 --Changing Humanoid speed

We can also write it in single line to make it much smaller:

game:GetService("Players").LocalPlayer.Character:FindFirstChild("Humanoid").WalkSpeed = 35

Answer this question