Pressing K Doesn't change the walkspeed

Screenshot 2024-01-02 021153

For some reason this doesn’t work. I’ve scripted another thing for dashing and it changes its walkspeed but here it doesn’t?

2 Likes

change if gpe then return end
to if not gpe then return end

1 Like

Just changed it to that and still having the same issue

1 Like

local humanoid = character:WaitForChild(“Humanoid”)

if gpe then return end

try both of these

1 Like

t try changing local charactar and local humanoid to

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

local humanoid = character:WaitForChild(“Humanoid”)

1 Like

if the local script is in starter pack then it shouldnt be a problem with local character = player.Character

1 Like

Did what you both did and it’s still not going through. I even added print to the script and, the script is being activated it’s just the WalkSpeed that’s not being played for some reason.

i put the locals for the humanoid and the character into the keypress function and it works for me

image

1 Like

I just went into another experience and it works there so i guess the problem would be the experience that im in right now

1 Like

oh ok aaaaaaaaaaaaaaaaaaaaaaaa

1 Like
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

Might be a problem on how you get the humanoid and the character

3 Likes

The issue is, the humanoid walkspeed is not replicating onto the server, because it is being replicated on the CLIENT, so I would probably make a remote event that fires to the server, and a server script that receives the OnServerEvent function, send the humanoid and the requested speed, and set the walkspeed there.

1 Like

I’ll try this since I’m not awake at 4 am trying to fix this and I actually have a brain now.

1 Like

THANK YOU This solved it but also i did notice that the sprinting in my game was the issue breaking the script so i changed the sprinting so hopefully it doesn’t mess up anything that i script but this was the one that fixed it so Thanks!

1 Like

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