Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local inputService = game:GetService("UserInputService")
- --Settings(can be changed)
- local normalWalkSpeed = 16
- local sprintWalkSpeed = 32
- local key = Enum.KeyCode.LeftShift
- inputService.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.Keyboard then
- local keycode = input.KeyCode
- if keycode == key then
- local character = game.Players.LocalPlayer.Character
- local humanoid = character:WaitForChild("Humanoid")
- humanoid.WalkSpeed = sprintWalkSpeed
- end
- end
- end)
- inputService.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.Keyboard then
- local keycode = input.KeyCode
- if keycode == key then
- local character = game.Players.LocalPlayer.Character
- local humanoid = character:WaitForChild("Humanoid")
- humanoid.WalkSpeed = normalWalkSpeed
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement