Advertisement
Baginpreyl

Speed script by ai

Apr 25th, 2024
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. -- Define a function to create the speed GUI
  2. local function createSpeedGUI()
  3. -- Create a ScreenGui object
  4. local gui = Instance.new("ScreenGui")
  5. gui.Name = "SpeedGUI"
  6. gui.Parent = game.Players.LocalPlayer.PlayerGui
  7.  
  8. -- Create a Frame to hold the GUI elements
  9. local frame = Instance.new("Frame")
  10. frame.Size = UDim2.new(0, 200, 0, 100) -- Set size
  11. frame.Position = UDim2.new(0, 10, 0, 10) -- Set position
  12. frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- White background
  13. frame.Parent = gui
  14.  
  15. -- Create a TextLabel for the title
  16. local titleLabel = Instance.new("TextLabel")
  17. titleLabel.Size = UDim2.new(1, 0, 0, 30)
  18. titleLabel.Position = UDim2.new(0, 0, 0, 0)
  19. titleLabel.Text = "Speed GUI"
  20. titleLabel.Font = Enum.Font.SourceSansBold
  21. titleLabel.TextSize = 18
  22. titleLabel.TextColor3 = Color3.fromRGB(0, 0, 0) -- Black text
  23. titleLabel.Parent = frame
  24.  
  25. -- Create a TextBox for speed input
  26. local speedTextBox = Instance.new("TextBox")
  27. speedTextBox.Size = UDim2.new(0.8, 0, 0, 30)
  28. speedTextBox.Position = UDim2.new(0.1, 0, 0, 40)
  29. speedTextBox.PlaceholderText = "Enter speed value..."
  30. speedTextBox.Parent = frame
  31.  
  32. -- Create a TextButton to set speed
  33. local setSpeedButton = Instance.new("TextButton")
  34. setSpeedButton.Size = UDim2.new(0.4, 0, 0, 30)
  35. setSpeedButton.Position = UDim2.new(0.1, 0, 0, 80)
  36. setSpeedButton.Text = "Set Speed"
  37. setSpeedButton.Parent = frame
  38.  
  39. -- Define the action when the button is clicked
  40. setSpeedButton.MouseButton1Click:Connect(function()
  41. local speedValue = tonumber(speedTextBox.Text)
  42. if speedValue then
  43. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = speedValue
  44. else
  45. print("Invalid speed value entered!")
  46. end
  47. end)
  48. end
  49.  
  50. -- Call the function to create the speed GUI
  51. createSpeedGUI()
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement