Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Add a LocalScript into StarterGui, and add a Configurations folder with 2 number values: runSpeed and normalSpeed
- -- Btw I dont indent
- -- Services
- local inputService = game:GetService("UserInputService")
- local playerService = game:GetService("Players")
- -- Objects
- local plr = playerService.LocalPlayer
- local char = plr.Character or plr.CharacterAdded:Wait()
- local settingsDir = script.Settings
- function getSetting (name)
- return settingsDir and settingsDir:FindFirstChild(name) and settingsDir[name].Value
- end
- local normalSpeed = getSetting("WalkSpeed") or 16
- local runSpeed = getSetting("RunSpeed") or 26
- local running = 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 = runSpeed
- 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