Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Create ScreenGui
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- -- Create Frame for background (Black Theme)
- local backgroundFrame = Instance.new("Frame")
- backgroundFrame.Size = UDim2.new(0, 300, 0, 400) -- Adjusted size to fit the new elements
- backgroundFrame.Position = UDim2.new(0.5, -150, 0.5, -200) -- Center the frame
- backgroundFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0) -- Black background
- backgroundFrame.Active = true -- Enable dragging
- backgroundFrame.Draggable = true -- Make the GUI draggable for mobile and PC
- backgroundFrame.Parent = screenGui
- -- Create smaller "X" button to close the GUI
- local closeButton = Instance.new("TextButton")
- closeButton.Size = UDim2.new(0, 30, 0, 30) -- Smaller size for the "X" button
- closeButton.Position = UDim2.new(0, 0, 0, 0) -- Top-left corner
- closeButton.Text = "X"
- closeButton.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text for the "X"
- closeButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50) -- Dark grey background for the "X"
- closeButton.Parent = backgroundFrame
- -- Create TextBox for Speed
- local textBox = Instance.new("TextBox")
- textBox.Size = UDim2.new(0, 250, 0, 50) -- Set size
- textBox.Position = UDim2.new(0.5, -125, 0.15, -25) -- Position inside the frame
- textBox.PlaceholderText = "Enter Number"
- textBox.Text = ""
- textBox.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
- textBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50) -- Dark grey background for TextBox
- textBox.Parent = backgroundFrame
- -- Create a white line between the speed TextBox and button
- local line1 = Instance.new("Frame")
- line1.Size = UDim2.new(0, 250, 0, 2) -- Thin line
- line1.Position = UDim2.new(0.5, -125, 0.33, 0) -- Positioned between TextBox and Button
- line1.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- White line
- line1.Parent = backgroundFrame
- -- Create Change Speed Button
- local changeSpeedButton = Instance.new("TextButton")
- changeSpeedButton.Size = UDim2.new(0, 250, 0, 50) -- Set size
- changeSpeedButton.Position = UDim2.new(0.5, -125, 0.35, -25) -- Position below the TextBox
- changeSpeedButton.Text = "Change Speed"
- changeSpeedButton.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
- changeSpeedButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50) -- Dark grey background for button
- changeSpeedButton.Parent = backgroundFrame
- -- Create TextBox for Jump Power
- local jumpPowerTextBox = Instance.new("TextBox")
- jumpPowerTextBox.Size = UDim2.new(0, 250, 0, 50) -- Set size
- jumpPowerTextBox.Position = UDim2.new(0.5, -125, 0.45, 25) -- Adjusted position for consistent spacing
- jumpPowerTextBox.PlaceholderText = "Enter Number"
- jumpPowerTextBox.Text = ""
- jumpPowerTextBox.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
- jumpPowerTextBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50) -- Dark grey background for TextBox
- jumpPowerTextBox.Parent = backgroundFrame
- -- Create Change Jump Power Button
- local changeJumpPowerButton = Instance.new("TextButton")
- changeJumpPowerButton.Size = UDim2.new(0, 250, 0, 50) -- Set size
- changeJumpPowerButton.Position = UDim2.new(0.5, -125, 0.65, 25) -- Position below the Jump Power TextBox
- changeJumpPowerButton.Text = "Change Jump Power"
- changeJumpPowerButton.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
- changeJumpPowerButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50) -- Dark grey background for button
- changeJumpPowerButton.Parent = backgroundFrame
- -- Create Toggle Button to reopen GUI
- local toggleButton = Instance.new("TextButton")
- toggleButton.Size = UDim2.new(0, 100, 0, 50) -- Size of the toggle button
- toggleButton.Position = UDim2.new(0, 10, 0, 10) -- Position in the bottom left corner of the screen
- toggleButton.Text = "Toggle GUI"
- toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
- toggleButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50) -- Dark grey background
- toggleButton.Parent = screenGui
- toggleButton.Visible = false -- Initially hidden until the GUI is closed
- -- Function to change player's speed when the button is clicked
- changeSpeedButton.MouseButton1Click:Connect(function()
- local speedValue = tonumber(textBox.Text) -- Convert TextBox input to a number
- if speedValue then
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- -- Change the player's walk speed
- humanoid.WalkSpeed = speedValue
- else
- print("Please enter a valid number")
- end
- end)
- -- Function to change player's jump power when the button is clicked
- changeJumpPowerButton.MouseButton1Click:Connect(function()
- local jumpPowerValue = tonumber(jumpPowerTextBox.Text) -- Convert Jump Power TextBox input to a number
- if jumpPowerValue then
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- -- Change the player's jump power
- humanoid.JumpPower = jumpPowerValue
- else
- print("Please enter a valid number")
- end
- end)
- -- Function to close the GUI when "X" is clicked
- closeButton.MouseButton1Click:Connect(function()
- backgroundFrame.Visible = false -- Hide the background frame
- toggleButton.Visible = true -- Show the toggle button
- end)
- -- Function to reopen the GUI when the toggle button is clicked
- toggleButton.MouseButton1Click:Connect(function()
- backgroundFrame.Visible = true -- Show the background frame
- toggleButton.Visible = false -- Hide the toggle button
- end)
- -- Optional: Set default walk speed and jump power upon character respawn
- game.Players.LocalPlayer.CharacterAdded:Connect(function(character)
- local humanoid = character:WaitForChild("Humanoid")
- humanoid.WalkSpeed = 16 -- Roblox default walk speed
- humanoid.JumpPower = 50 -- Roblox default jump power
- end)
Advertisement
Add Comment
Please, Sign In to add comment