-- Services local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer -- Settings local DESIRED_SPEED = 50 local DEFAULT_SPEED = 16 -- State local speedEnabled = false local guiVisible = true -- ====================== -- GUI SETUP -- ====================== local gui = Instance.new("ScreenGui") gui.Name = "SpeedToggleGui" gui.ResetOnSpawn = false gui.Parent = player:WaitForChild("PlayerGui") local frame = Instance.new("Frame") frame.Size = UDim2.fromScale(0.2, 0.12) frame.Position = UDim2.fromScale(0.4, 0.1) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) frame.Parent = gui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 12) corner.Parent = frame local button = Instance.new("TextButton") button.Size = UDim2.fromScale(0.9, 0.6) button.Position = UDim2.fromScale(0.05, 0.2) button.TextScaled = true button.Font = Enum.Font.GothamBold button.TextColor3 = Color3.new(1, 1, 1) button.Parent = frame -- ====================== -- FUNCTIONS -- ====================== local function updateButton() if speedEnabled then button.Text = "Speed: ON" button.BackgroundColor3 = Color3.fromRGB(0, 170, 0) else button.Text = "Speed: OFF" button.BackgroundColor3 = Color3.fromRGB(170, 0, 0) end end local function applySpeed(humanoid) if speedEnabled then humanoid.WalkSpeed = DESIRED_SPEED else humanoid.WalkSpeed = DEFAULT_SPEED end end local function onCharacterAdded(character) local humanoid = character:WaitForChild("Humanoid") -- Keep speed enforced task.spawn(function() while humanoid.Parent do applySpeed(humanoid) task.wait(0.1) end end) end -- ====================== -- BUTTON TOGGLE -- ====================== button.MouseButton1Click:Connect(function() speedEnabled = not speedEnabled updateButton() if player.Character then local humanoid = player.Character:FindFirstChild("Humanoid") if humanoid then applySpeed(humanoid) end end end) -- ====================== -- ALT KEY TO HIDE GUI -- ====================== UserInputService.InputBegan:Connect(function(input, gp) if gp then return end if input.KeyCode == Enum.KeyCode.LeftAlt or input.KeyCode == Enum.KeyCode.RightAlt then guiVisible = not guiVisible frame.Visible = guiVisible end end) -- ====================== -- INIT -- ====================== updateButton() player.CharacterAdded:Connect(onCharacterAdded) if player.Character then onCharacterAdded(player.Character) end