Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local char = script.Parent
- local hum = char:WaitForChild("Humanoid")
- local uis = game:GetService("UserInputService")
- local running = false
- function setSpeed()
- if running == true then
- hum.WalkSpeed = 32
- else
- hum.WalkSpeed = 16
- end
- end
- uis.InputBegan:Connect(function(input, isTyping)
- if not isTyping then
- if input.KeyCode == Enum.KeyCode.LeftShift or input.KeyCode == Enum.KeyCode.RightShift then
- running = true
- setSpeed()
- end
- end
- end)
- uis.InputEnded:Connect(function(input, isTyping)
- if not isTyping then
- if input.KeyCode == Enum.KeyCode.LeftShift or input.KeyCode == Enum.KeyCode.RightShift then
- running = false
- setSpeed()
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement