-- Create the ScreenGui and Parent it to the Player's PlayerGui local player = game.Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local screenGui = Instance.new("ScreenGui") screenGui.Parent = playerGui -- Create the main Frame for the UI local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 300, 0, 150) frame.Position = UDim2.new(0.5, -150, 0.5, -75) frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50) frame.Parent = screenGui -- Create the TextBox for entering the speed local speedTextBox = Instance.new("TextBox") speedTextBox.Size = UDim2.new(0, 200, 0, 50) speedTextBox.Position = UDim2.new(0, 50, 0, 25) speedTextBox.Text = "Enter Speed" speedTextBox.ClearTextOnFocus = true speedTextBox.Parent = frame -- Create the Button to apply the speed local applyButton = Instance.new("TextButton") applyButton.Size = UDim2.new(0, 100, 0, 40) applyButton.Position = UDim2.new(0.5, -50, 1, -60) applyButton.Text = "Apply Speed" applyButton.Parent = frame -- Function to apply the speed local function applySpeed() local speedValue = tonumber(speedTextBox.Text) if speedValue and speedValue > 0 then -- Set the character's walk speed player.Character:WaitForChild("Humanoid").WalkSpeed = speedValue else -- Show error if input is invalid print("Please enter a valid speed number.") end end -- Connect the button to the applySpeed function applyButton.MouseButton1Click:Connect(applySpeed) -- Variables for dragging the frame local dragging = false local dragStart = nil local startPos = nil -- Function to start dragging frame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = true dragStart = input.Position startPos = frame.Position end end) -- Function to stop dragging frame.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = false end end) -- Function to update the position of the frame while dragging frame.InputChanged:Connect(function(input) if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then 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 end) -- Fix for ensuring the GUI appears correctly screenGui.Enabled = true frame.Visible = true