Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Local script
- -- Shift to Sprint
- -- Put in StarterGui
- -- (sorry for not fixing it before)
- inputService = game:GetService("UserInputService")
- local plr = game.Players.LocalPlayer
- local char = plr.Character or plr.CharacterAdded:wait()
- local normalSpeed = 16 -- The player's speed while not sprinting
- local sprintSpeed = 26 -- The player's speed while sprinting
- local sprinting = false
- inputService.InputBegan:Connect(function (key)
- if key.KeyCode == Enum.KeyCode.LeftShift or key.KeyCode == Enum.KeyCode.RightShift then
- running = true
- if char.Humanoid then
- char.Humanoid.WalkSpeed = sprintSpeed
- end
- end
- end)
- inputService.InputEnded:Connect(function (key)
- if key.KeyCode == Enum.KeyCode.LeftShift or key.KeyCode == Enum.KeyCode.RightShift then
- running = false
- if char.Humanoid then
- char.Humanoid.WalkSpeed = normalSpeed
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement