Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Define a function to create the speed GUI
- local function createSpeedGUI()
- -- Create a ScreenGui object
- local gui = Instance.new("ScreenGui")
- gui.Name = "SpeedGUI"
- gui.Parent = game.Players.LocalPlayer.PlayerGui
- -- Create a Frame to hold the GUI elements
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(0, 200, 0, 100) -- Set size
- frame.Position = UDim2.new(0, 10, 0, 10) -- Set position
- frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- White background
- frame.Parent = gui
- -- Create a TextLabel for the title
- local titleLabel = Instance.new("TextLabel")
- titleLabel.Size = UDim2.new(1, 0, 0, 30)
- titleLabel.Position = UDim2.new(0, 0, 0, 0)
- titleLabel.Text = "Speed GUI"
- titleLabel.Font = Enum.Font.SourceSansBold
- titleLabel.TextSize = 18
- titleLabel.TextColor3 = Color3.fromRGB(0, 0, 0) -- Black text
- titleLabel.Parent = frame
- -- Create a TextBox for speed input
- local speedTextBox = Instance.new("TextBox")
- speedTextBox.Size = UDim2.new(0.8, 0, 0, 30)
- speedTextBox.Position = UDim2.new(0.1, 0, 0, 40)
- speedTextBox.PlaceholderText = "Enter speed value..."
- speedTextBox.Parent = frame
- -- Create a TextButton to set speed
- local setSpeedButton = Instance.new("TextButton")
- setSpeedButton.Size = UDim2.new(0.4, 0, 0, 30)
- setSpeedButton.Position = UDim2.new(0.1, 0, 0, 80)
- setSpeedButton.Text = "Set Speed"
- setSpeedButton.Parent = frame
- -- Define the action when the button is clicked
- setSpeedButton.MouseButton1Click:Connect(function()
- local speedValue = tonumber(speedTextBox.Text)
- if speedValue then
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = speedValue
- else
- print("Invalid speed value entered!")
- end
- end)
- end
- -- Call the function to create the speed GUI
- createSpeedGUI()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement