Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Create a ScreenGui
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- -- Create a Frame
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(0, 250, 0, 150)
- frame.Position = UDim2.new(0.5, -125, 0.5, -75)
- frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- frame.Active = true
- frame.Draggable = true
- frame.Parent = screenGui
- -- Add a UIGradient for the rainbow effect
- local gradient = Instance.new("UIGradient")
- gradient.Color = ColorSequence.new {
- ColorSequenceKeypoint.new(0.00, Color3.fromRGB(255, 0, 0)), -- Red
- ColorSequenceKeypoint.new(0.17, Color3.fromRGB(255, 127, 0)), -- Orange
- ColorSequenceKeypoint.new(0.33, Color3.fromRGB(255, 255, 0)), -- Yellow
- ColorSequenceKeypoint.new(0.50, Color3.fromRGB(0, 255, 0)), -- Green
- ColorSequenceKeypoint.new(0.67, Color3.fromRGB(0, 0, 255)), -- Blue
- ColorSequenceKeypoint.new(0.83, Color3.fromRGB(75, 0, 130)), -- Indigo
- ColorSequenceKeypoint.new(1.00, Color3.fromRGB(148, 0, 211)) -- Violet
- }
- gradient.Parent = frame
- -- Create a TextBox
- local textBox = Instance.new("TextBox")
- textBox.Size = UDim2.new(0.8, 0, 0.2, 0)
- textBox.Position = UDim2.new(0.1, 0, 0.1, 0)
- textBox.PlaceholderText = "Enter Speed"
- textBox.Text = ""
- textBox.Parent = frame
- -- Create a TextButton
- local button = Instance.new("TextButton")
- button.Size = UDim2.new(0.8, 0, 0.2, 0)
- button.Position = UDim2.new(0.1, 0, 0.35, 0)
- button.Text = "Change Speed"
- button.Parent = frame
- -- Create a TextLabel for credits
- local credits = Instance.new("TextLabel")
- credits.Size = UDim2.new(1, 0, 0.2, 0)
- credits.Position = UDim2.new(0, 0, 0.7, 0)
- credits.Text = "Made by Kelsondre. Follow me on Roblox, I am Luckymenslostacc"
- credits.TextColor3 = Color3.fromRGB(255, 255, 255)
- credits.BackgroundTransparency = 1
- credits.TextScaled = true
- credits.Parent = frame
- -- Function to change the player's speed
- local function changeSpeed()
- local speed = tonumber(textBox.Text)
- if speed then
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- humanoid.WalkSpeed = speed -- Set the speed from the TextBox
- else
- print("Invalid speed value")
- end
- end
- -- Connect the button click to the changeSpeed function
- button.MouseButton1Click:Connect(changeSpeed)
- -- Make the frame draggable on mobile
- local UIS = game:GetService("UserInputService")
- local dragging = false
- local dragInput, dragStart, startPos
- local function update(input)
- local delta = input.Position - dragStart
- frame.Position = UDim2.new(
- startPos.X.Scale,
- startPos.X.Offset + delta.X,
- startPos.Y.Scale,
- startPos.Y.Offset + delta.Y
- )
- end
- frame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = frame.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- frame.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- UIS.InputChanged:Connect(function(input)
- if dragging and input == dragInput then
- update(input)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement