Why won't this shift to sprint script function?
Asked by
5 years ago Edited 5 years ago
I'd like to implement this short sprint script into my game however it won't work and I can't identify the problem. Your help would be greatly appreciated. :)
01 | local Player = game.Players.LocalPlayer |
02 | Player.CharacterAdded:wait() |
04 | local Mouse = Player:GetMouse() |
06 | local Humanoid = Player.Character:WaitForChild( "Humanoid" ) |
07 | local OrigSpeed = Humanoid.WalkSpeed |
10 | Mouse.KeyDown:connect( function (Key) |
12 | if Key = = Enum.KeyCode.LeftShift and active = = false then |
13 | Humanoid.WalkSpeed = Speed |
15 | elseif Key = = Enum.KeyCode.LeftShift and active = = true then |
16 | Humanoid.WalkSpeed = OrigSpeed |