In my game there is a shift to sprint script however for some reason it won't function and I can't identify the problem. Any help would be greatly appreciated! :)
Here is the script:
local UserInputService = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
Player.CharacterAdded:wait()
local Mouse = Player:GetMouse()
local Speed = 33
local Humanoid = Player.Character:WaitForChild("Humanoid")
local OrigSpeed = Humanoid.WalkSpeed
local active = false
UserInputService.InputBegan:Connect(function(input)
local key = input.KeyCode
if key == Enum.KeyCode.LeftShift and active == false then
Humanoid.WalkSpeed = Speed
active = true
elseif key == Enum.KeyCode.LeftShift and active == true then
Humanoid.WalkSpeed = OrigSpeed
active = false
end
end)
