Advertisement
MahbirRafan123

Speed script but modified a bit

Feb 5th, 2025
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. --[[
  2. WARNING: Heads up! This script has not been verified by ScriptBlox. Use at your own risk!
  3. ]]
  4. -- Create GUI elements
  5. local ScreenGui = Instance.new("ScreenGui")
  6. local Frame = Instance.new("Frame")
  7. local TextLabel = Instance.new("TextLabel")
  8. local TextBox = Instance.new("TextBox")
  9.  
  10. -- Set properties for ScreenGui
  11. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  12.  
  13. -- Set properties for Frame
  14. Frame.Parent = ScreenGui
  15. Frame.BackgroundColor3 = Color3.fromRGB(128, 128, 128) -- Grey color
  16. Frame.Size = UDim2.new(0, 200, 0, 100)
  17. Frame.Position = UDim2.new(0.5, -100, 0.5, -50) -- Centered
  18.  
  19. -- Set properties for TextLabel
  20. TextLabel.Parent = Frame
  21. TextLabel.Text = "Speed"
  22. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 0) -- Yellow color
  23. TextLabel.Size = UDim2.new(1, 0, 0.4, 0)
  24. TextLabel.Position = UDim2.new(0, 0, 0, 0)
  25. TextLabel.TextScaled = true
  26.  
  27. -- Set properties for TextBox
  28. TextBox.Parent = Frame
  29. TextBox.TextColor3 = Color3.fromRGB(255, 192, 203) -- Pink color
  30. TextBox.Size = UDim2.new(1, 0, 0.6, 0)
  31. TextBox.Position = UDim2.new(0, 0, 0.4, 0)
  32. TextBox.PlaceholderText = "Enter speed (max 9999999999999999999999999999999)"
  33. TextBox.TextScaled = true
  34.  
  35. -- Make the frame draggable
  36. local UserInputService = game:GetService("UserInputService")
  37. local dragging, dragInput, dragStart, startPos
  38.  
  39. local function update(input)
  40. local delta = input.Position - dragStart
  41. Frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  42. end
  43.  
  44. Frame.InputBegan:Connect(function(input)
  45. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  46. dragging = true
  47. dragStart = input.Position
  48. startPos = Frame.Position
  49.  
  50. input.Changed:Connect(function()
  51. if input.UserInputState == Enum.UserInputState.End then
  52. dragging = false
  53. end
  54. end)
  55. end
  56. end)
  57.  
  58. Frame.InputChanged:Connect(function(input)
  59. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  60. dragInput = input
  61. end
  62. end)
  63.  
  64. UserInputService.InputChanged:Connect(function(input)
  65. if dragging and input == dragInput then
  66. update(input)
  67. end
  68. end)
  69.  
  70. -- Update player speed based on TextBox input
  71. TextBox.FocusLost:Connect(function(enterPressed)
  72. if enterPressed then
  73. local speed = tonumber(TextBox.Text)
  74. if speed then
  75. speed = math.clamp(speed, 0, 9999999999999999999999999999999)
  76. local player = game.Players.LocalPlayer
  77. local character = player.Character or player.CharacterAdded:Wait()
  78. local humanoid = character:WaitForChild("Humanoid")
  79. humanoid.WalkSpeed = speed
  80. end
  81. end
  82. end)
  83.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement