Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- please give credit - zen
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local isSprinting = false
- local normalWalkSpeed = humanoid.WalkSpeed
- local sprintWalkSpeed = 30
- local function startSprinting()
- if isSprinting then
- return
- end
- isSprinting = true
- humanoid.WalkSpeed = sprintWalkSpeed
- end
- local function stopSprinting()
- if not isSprinting then
- return
- end
- isSprinting = false
- humanoid.WalkSpeed = normalWalkSpeed
- end
- game:GetService("UserInputService").InputBegan:Connect(function(input)
- if input.KeyCode == Enum.KeyCode.LeftControl then
- startSprinting()
- end
- end)
- game:GetService("UserInputService").InputEnded:Connect(function(input)
- if input.KeyCode == Enum.KeyCode.LeftControl then
- stopSprinting()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement