How do i access player walkspeed

Trying to work on my first script after watching a few tutorials and I get the basic gist of it but despite googling i can’t find any information regarding how to access the player walkspeed. I’m trying to make a shift to sprint script.

1 Like

The players character has a Humanoid instance that has the WalkSpeed attribute.

1 Like

Use Player.Character.Humanoid.WalkSpeed

Not sure if you’re trying to do this from a local or server script though so tell me so I can help some more

well it is located inside starterplayerscripts so, server maybe? I’m not sure since i’m literally beginning.

When you look at the script in the explorer is it blue or white

It’s colored white so probably server script.

I see… Probably the easiest way to make this beginner friendly is by replacing it with a local script, I’ll help you after that

1 Like

I believe this is what you want:

image

local PS = game:GetService("Players")
local localPlayer = PS.LocalPlayer

localPlayer.Character.Humanoid.WalkSpeed = 100
1 Like

I wanna try doing the script on my own but still thanks.

Alright, use user input service so you know when the player presses and releases shift

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.