Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.StarterGui:SetCore('SendNotification', {
- Title = script.Name,
- Text = script.Name..' has loaded. Press and hold \'Shift\' to 🏃 and release to 🚶.',
- Duration = 10
- })
- -- Wait Function --
- game:WaitForChild('Players')
- -- Variables --
- Player = game.Players.LocalPlayer
- Character = Player.Character
- Humanoid = Character.Humanoid
- UserInputService = game:GetService('UserInputService')
- function SetWalkSpeed(NewSpeed, Input, Processed, Key1, Key2)
- if Player ~= nil then
- if Character ~= nil then
- if Humanoid ~= nil then
- if Input.KeyCode == Key1 or Input.KeyCode == Key2 then
- Processed = true
- Humanoid.WalkSpeed = NewSpeed
- Processed = false
- end
- end
- end
- end
- end
- UserInputService.InputBegan:Connect(function(input, processed)
- SetWalkSpeed(30, input, processed, Enum.KeyCode.LeftControl, Enum.KeyCode.RightControl) -- replace '30' with whatever speed above 16
- end)
- UserInputService.InputEnded:Connect(function(input, processed)
- SetWalkSpeed(16, input, processed, Enum.KeyCode.LeftControl, Enum.KeyCode.RightControl) -- replace '16' with whatever speed below or at 16
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement