Humanoid WalkSpeed doesn't change

Recently i ran into a pretty weird issue.
I had a Running / Sprinting Local Script in the players StarterGUI. Using LSHIFT + W.
But for some reason the Humoids WalkSpeed would not change.
I ran some tests:

  • Simple local script that Fires a Remote event to the Server and changes the players WalkSpeed
    remote:FireServer(28)

  • The Server Script Prints the New walkspeed and changes the Humanoids WalkSpeed

speed.OnServerEvent:Connect(function(player, value)
local char = player.Character
	print(value)

		player.Character:FindFirstChildWhichIsA("Humanoid").WalkSpeed = value

	
end)
  • Here is my output

Where is the Issue? did i miss something? Thanks for reading

2 Likes

First print the Humanoid.WalkSpeed at the end just to make sure it isnt changing it, if its not try setting a variable for the Humanoid first then changing the speed.

Weird thing is, this issue appeared out of no where. My Sprinting used to work. Suddenly it stopped working

Weird. Did you change anything? Or do you have any other scripts that affect the speed?

No i had one local script in a GUI. It suddenly stopped working without me touching it.
I also tried if some of the Most popular Toolbox Sprint scripts worked. They didn’t

1 Like

Try restarting roblox studio, maybe that will fix it.

2 Likes

Since the bugged occured, i reinstalled studio Twice.
Plus, what could that change?
i am confused

2 Likes

Sometimes it breaks, but since you reinstalled it twice and didn’t change anything i don’t know what could be causing it. Does it work outside of studio?

2 Likes

What if you try it from a local script?

2 Likes

Sigh It doesnt and i have no idea what could be causing this. I tried removing the animations and doing scripts from scratch. The WalkSpeed stays always the same, regardless Server or Client Script

1 Like

It was originally made on a Local Script.
I tried server and Client

2 Likes

I don’t know why you are doing it in a server script. Instead of calling an event just use this code in the local script.

local player = game.Players.LocalPlayer
player.Character.Humanoid.WalkSpeed = value

3 Likes

Try this:

speed.OnServerEvent:Connect(function(player, value)

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

    print(value)

    char:FindFirstChild("Humanoid").WalkSpeed = value
end)
2 Likes

The script was originally local. Since it did not work, i tried doing it on the server

2 Likes

Nope that did not help. I tried on the Client again. No result, walkspeed is still 16, regardless

2 Likes

If I understand you correctly, you want to change the humanoid walkspeed by holding LeftShift. Try this In a local script (put It Inside of a StarterCharacterScripts)

local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.LeftShift then
		script.Parent:WaitForChild("Humanoid").WalkSpeed = 28 -- running walkspeed
	end
end)

UIS.InputEnded:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.LeftShift then
		script.Parent:WaitForChild("Humanoid").WalkSpeed = 16 -- default walkspeed
	end
end)
1 Like

No. i already made a Local Script that changes the walkspeed using shift. The problem is, 2 days later, after i finished the script and started working on the map, the script randomly stopped working. I tried on the server.

Also,

  • My game has weapons, when you equip them, your speed is reduced. That stopped working too, although i remember it working perfectly
1 Like

You might have another script changing from time to time the WalkSpeed. Also you don’t need to fire a RemoteEvent for the WalkSpeed to change, you could simply do that from a local script.

2 Likes

Originally, my script was local.
It was very similar to @Ghostitsme script, except it also had a stamina GUI connected to it and a Camera Tween.

I just ran some simple tests on the Server, to see if it works. Nothing works, the humanoid Walkspeed just would not change.

1 Like

Do Ctrl + Shift + F and search for

.WalkSpeed = 

to see if any script is setting the walkspeed besides yours, it could just be a script is resetting it so its not being changed.

6 Likes