Advertisement
Kelsondre69

Roblox speed giver script

May 29th, 2024 (edited)
926
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.60 KB | None | 0 0
  1. -- Create a ScreenGui
  2. local screenGui = Instance.new("ScreenGui")
  3. screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  4.  
  5. -- Create a Frame
  6. local frame = Instance.new("Frame")
  7. frame.Size = UDim2.new(0, 250, 0, 150)
  8. frame.Position = UDim2.new(0.5, -125, 0.5, -75)
  9. frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  10. frame.Active = true
  11. frame.Draggable = true
  12. frame.Parent = screenGui
  13.  
  14. -- Add a UIGradient for the rainbow effect
  15. local gradient = Instance.new("UIGradient")
  16. gradient.Color = ColorSequence.new {
  17. ColorSequenceKeypoint.new(0.00, Color3.fromRGB(255, 0, 0)), -- Red
  18. ColorSequenceKeypoint.new(0.17, Color3.fromRGB(255, 127, 0)), -- Orange
  19. ColorSequenceKeypoint.new(0.33, Color3.fromRGB(255, 255, 0)), -- Yellow
  20. ColorSequenceKeypoint.new(0.50, Color3.fromRGB(0, 255, 0)), -- Green
  21. ColorSequenceKeypoint.new(0.67, Color3.fromRGB(0, 0, 255)), -- Blue
  22. ColorSequenceKeypoint.new(0.83, Color3.fromRGB(75, 0, 130)), -- Indigo
  23. ColorSequenceKeypoint.new(1.00, Color3.fromRGB(148, 0, 211)) -- Violet
  24. }
  25. gradient.Parent = frame
  26.  
  27. -- Create a TextBox
  28. local textBox = Instance.new("TextBox")
  29. textBox.Size = UDim2.new(0.8, 0, 0.2, 0)
  30. textBox.Position = UDim2.new(0.1, 0, 0.1, 0)
  31. textBox.PlaceholderText = "Enter Speed"
  32. textBox.Text = ""
  33. textBox.Parent = frame
  34.  
  35. -- Create a TextButton
  36. local button = Instance.new("TextButton")
  37. button.Size = UDim2.new(0.8, 0, 0.2, 0)
  38. button.Position = UDim2.new(0.1, 0, 0.35, 0)
  39. button.Text = "Change Speed"
  40. button.Parent = frame
  41.  
  42. -- Create a TextLabel for credits
  43. local credits = Instance.new("TextLabel")
  44. credits.Size = UDim2.new(1, 0, 0.2, 0)
  45. credits.Position = UDim2.new(0, 0, 0.7, 0)
  46. credits.Text = "Made by Kelsondre. Follow me on Roblox, I am Luckymenslostacc"
  47. credits.TextColor3 = Color3.fromRGB(255, 255, 255)
  48. credits.BackgroundTransparency = 1
  49. credits.TextScaled = true
  50. credits.Parent = frame
  51.  
  52. -- Function to change the player's speed
  53. local function changeSpeed()
  54. local speed = tonumber(textBox.Text)
  55. if speed then
  56. local player = game.Players.LocalPlayer
  57. local character = player.Character or player.CharacterAdded:Wait()
  58. local humanoid = character:WaitForChild("Humanoid")
  59. humanoid.WalkSpeed = speed -- Set the speed from the TextBox
  60. else
  61. print("Invalid speed value")
  62. end
  63. end
  64.  
  65. -- Connect the button click to the changeSpeed function
  66. button.MouseButton1Click:Connect(changeSpeed)
  67.  
  68. -- Make the frame draggable on mobile
  69. local UIS = game:GetService("UserInputService")
  70.  
  71. local dragging = false
  72. local dragInput, dragStart, startPos
  73.  
  74. local function update(input)
  75. local delta = input.Position - dragStart
  76. frame.Position = UDim2.new(
  77. startPos.X.Scale,
  78. startPos.X.Offset + delta.X,
  79. startPos.Y.Scale,
  80. startPos.Y.Offset + delta.Y
  81. )
  82. end
  83.  
  84. frame.InputBegan:Connect(function(input)
  85. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  86. dragging = true
  87. dragStart = input.Position
  88. startPos = frame.Position
  89.  
  90. input.Changed:Connect(function()
  91. if input.UserInputState == Enum.UserInputState.End then
  92. dragging = false
  93. end
  94. end)
  95. end
  96. end)
  97.  
  98. frame.InputChanged:Connect(function(input)
  99. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  100. dragInput = input
  101. end
  102. end)
  103.  
  104. UIS.InputChanged:Connect(function(input)
  105. if dragging and input == dragInput then
  106. update(input)
  107. end
  108. end)
  109.  
Tags: #roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement