How do you make it like in games where pressing shift allows the character to move faster? Does it have anything to do with accelerating the moving animation of the humanoid that was my guess but im not sure
✓ ANSWER ACCEPTED
Sprint Button Thingy
1 answer
✓ Accepted answer
Here is a script for sprint when you press the left shift.
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local KeysDown = {}
Mouse.KeyDown:connect(function(Key)
if Key:lower() == "w" then
KeysDown["w"] = true
elseif Key:byte() == 48 then
KeysDown["Shift"] = true
end
if KeysDown["w"] and KeysDown["Shift"] then
Player.Character.Humanoid.WalkSpeed = 40
end
end)
Mouse.KeyUp:connect(function(Key)
if Key:lower() == "w" then
KeysDown["w"] = false
elseif Key:byte() == 48 then
KeysDown["Shift"] = false
end
if not KeysDown["w"] or not KeysDown["Shift"] then
Player.Character.Humanoid.WalkSpeed = 16
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Mouse is deprecated if you happen to bump on this question