Advertisement
MaxproGlitcher

Script by me for speed hack béta.lua

Apr 26th, 2024
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. -- Default walk speed
  2. local defaultWalkSpeed = 16
  3. local speedChangeAmountUp = 6 -- Amount to increase the speed by
  4. local speedChangeAmountDown = 4 -- Amount to decrease the speed by
  5. local maxWalkSpeed = 2000 -- Maximum walk speed limit
  6.  
  7. -- Create a ScreenGui to hold the GUI elements
  8. local gui = Instance.new("ScreenGui")
  9. gui.Parent = game.Players.LocalPlayer.PlayerGui
  10.  
  11. -- Create a Frame to hold the buttons
  12. local frame = Instance.new("Frame")
  13. frame.Size = UDim2.new(0, 200, 0, 100) -- Set the size of the frame
  14. frame.Position = UDim2.new(0.5, -100, 0.5, -50) -- Center the frame on the screen
  15. frame.BackgroundTransparency = 0.5 -- Make the frame semi-transparent
  16. frame.BackgroundColor3 = Color3.new(0, 0, 0) -- Set background color to black
  17. frame.Active = true -- Make the frame active to detect mouse input
  18. frame.Draggable = true -- Make the frame draggable
  19. frame.Parent = gui
  20.  
  21. -- Create the "Speed Up" button
  22. local speedUpButton = Instance.new("TextButton")
  23. speedUpButton.Size = UDim2.new(0, 100, 0, 50) -- Set the size of the button
  24. speedUpButton.Position = UDim2.new(0, 10, 0.5, -25) -- Position the button
  25. speedUpButton.Text = "Speed Up" -- Set the text of the button
  26. speedUpButton.Parent = frame
  27.  
  28. -- Create the "Speed Down" button
  29. local speedDownButton = Instance.new("TextButton")
  30. speedDownButton.Size = UDim2.new(0, 100, 0, 50) -- Set the size of the button
  31. speedDownButton.Position = UDim2.new(1, -110, 0.5, -25) -- Position the button
  32. speedDownButton.Text = "Speed Down" -- Set the text of the button
  33. speedDownButton.Parent = frame
  34.  
  35. -- Function to adjust the player's walk speed
  36. local function adjustWalkSpeed(amount)
  37. local humanoid = game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
  38. if humanoid then
  39. local newSpeed = humanoid.WalkSpeed + amount
  40. humanoid.WalkSpeed = math.clamp(newSpeed, 1, maxWalkSpeed) -- Cap at 1 to maxWalkSpeed units
  41. end
  42. end
  43.  
  44. -- Function to increase the player's walk speed
  45. local function speedUp()
  46. adjustWalkSpeed(speedChangeAmountUp)
  47. end
  48.  
  49. -- Function to decrease the player's walk speed
  50. local function speedDown()
  51. adjustWalkSpeed(-speedChangeAmountDown)
  52. end
  53.  
  54. -- Connect the functions to the button click events
  55. speedUpButton.MouseButton1Click:Connect(speedUp)
  56. speedDownButton.MouseButton1Click:Connect(speedDown)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement