I'm trying to make the player's walkspeed change to 30 while the enter key is being held down. And when it gets released, it changed back to 16.
But its not working
Script:
plr = script.Parent.Parent
mouse = plr:GetMouse()
mouse.KeyDown:connect(function(key)
if key == 13 then
plr.Character.Humanoid.WalkSpeed = 30
end
end)
mouse.KeyUp:connect(function(keyy)
if keyy == 13 then
plr.Character.Humanoid.WalkSpeed = 16
end
end)
THIS IS A NORMAL SCRIPT INSIDE STARTERPACK!

3 comments
To me, personally, it may be because your using a Server-Sided script, and not a Client-Sided script, because, I think 'GetMouse' can only be called from a Client-Sided script because of the 'LocalPlayer''s mouse, but, that's just me.
The Keydown part worked, but the KeyUp part didnt.
Why aren't you using the Byte() ?