Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

this sprint works but once a player dies it stops working why is that??

Asked by 1 year ago
wait(2)

local Player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local Humanoid = Player.Character.Humanoid

UIS.InputBegan:Connect(function(input, GameProcessedEvent)
    if input.KeyCode == Enum.KeyCode.LeftShift then
        Humanoid.WalkSpeed = 50
    end
end)

UIS.InputEnded:Connect(function(input, GameProcessedEvent)
    if input.KeyCode == Enum.KeyCode.LeftShift then
        Humanoid.WalkSpeed = 16
    end
end)

1 answer

Log in to vote
0
Answered by 1 year ago

i fixed it already by moving it to the startcharactersscripts isntead of starterplayerscripts

Ad

Answer this question