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
Here is a script for sprint when you press the left shift.
01 | local Player = game.Players.LocalPlayer |
02 | local Mouse = Player:GetMouse() |
03 | local KeysDown = { } |
04 |
05 | Mouse.KeyDown:connect( function (Key) |
06 | if Key:lower() = = "w" then |
07 | KeysDown [ "w" ] = true |
08 | elseif Key:byte() = = 48 then |
09 | KeysDown [ "Shift" ] = true |
10 | end |
11 |
12 | if KeysDown [ "w" ] and KeysDown [ "Shift" ] then |
13 | Player.Character.Humanoid.WalkSpeed = 40 |
14 | end |
15 | end ) |