Basic Speed GUI
Basic Speed GUI
-- Create an input box for the player to type the desired speed
local speedInput = Instance.new("TextBox")
speedInput.Size = UDim2.new(0, 200, 0, 40)
speedInput.Position = UDim2.new(0.5, -100, 0, 100)
speedInput.PlaceholderText = "Enter Speed (10-3000)"
speedInput.TextColor3 = Color3.fromRGB(255, 255, 255)
speedInput.BackgroundColor3 = Color3.fromRGB(50, 50, 170)
speedInput.TextSize = 18
speedInput.Font = Enum.Font.GothamBold
speedInput.Parent = mainFrame
button.MouseLeave:Connect(function()
createTween(button, TweenInfo.new(0.2, Enum.EasingStyle.Back,
Enum.EasingDirection.Out), {Size = UDim2.new(0, 120, 0, 40), BackgroundColor3 =
bgColor})
end)
button.MouseButton1Click:Connect(callback)
return button
end
closeButton.MouseButton1Click:Connect(function()
createTween(mainFrame, TweenInfo.new(0.2, Enum.EasingStyle.Back,
Enum.EasingDirection.Out), {Size = UDim2.new(0, 350, 0, 0)})
wait(0.2)
screenGui:Destroy() -- Close the UI with animation
end)
mainFrame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = mainFrame.Position
end
end)
mainFrame.InputChanged:Connect(function(input)
if dragging and input.UserInputType == Enum.UserInputType.MouseMovement
then
local delta = input.Position - dragStart
mainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset +
delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
end)
mainFrame.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = false
end
end)
end