Advertisement
JannickP8

[Roblox] Axtra's Running Script

Jul 19th, 2023 (edited)
1,097
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.29 KB | None | 1 0
  1. --Axtra's (cryptic's) Running Script
  2. --When you hold "C" your WalkSpeed will be the runSpeed you can set
  3. --When you stop holding "C" your WalkSpeed will be the normalSpeed you can set
  4. --reseting will stop the script so you can change the speeds
  5.  
  6. local runSpeed = 64 --change this to how fast you wanna run (16 = normal)
  7. local normalSpeed = 16 --change this if you want your normal speed to be higher
  8. local hum = game:GetService("Players").LocalPlayer.Character:WaitForChild("Humanoid")
  9. local UserInputService = game:GetService("UserInputService")
  10. local isRunning = false
  11.  
  12.  
  13. local function onKeyPress(input, gameProcessedEvent)
  14.     if gameProcessedEvent then
  15.         return
  16.     end
  17.  
  18.     if input.KeyCode == Enum.KeyCode.C then
  19.         print("Running script!")
  20.         hum.WalkSpeed = runSpeed
  21.         isRunning = true
  22.     end
  23. end
  24.  
  25.  
  26. local function onKeyRelease(input, gameProcessedEvent)
  27.     if gameProcessedEvent then
  28.         return
  29.     end
  30.  
  31.     if input.KeyCode == Enum.KeyCode.C then
  32.         print("Stopped script.")
  33.         hum.WalkSpeed = normalSpeed
  34.         isRunning = false
  35.     end
  36. end
  37.  
  38.  
  39. UserInputService.InputBegan:Connect(onKeyPress)
  40. UserInputService.InputEnded:Connect(onKeyRelease)
  41.  
  42.  
  43. while true do
  44.     if isRunning then
  45.         print("Running...")
  46.     end
  47.     wait()
  48. end
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement