-- Services local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") -- Variables local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local crouching = false local standingHeight = 2 local crouchingHeight = 1 -- GUI Setup local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "CrouchGui" ScreenGui.Parent = player.PlayerGui local CrouchButton = Instance.new("TextButton") CrouchButton.Size = UDim2.new(0, 100, 0, 30) CrouchButton.Position = UDim2.new(0, 10, 0, 10) CrouchButton.Text = "Crouch" CrouchButton.BackgroundColor3 = Color3.new(0.5, 0.5, 0.5) CrouchButton.Parent = ScreenGui -- Crouch Function local function ToggleCrouch() crouching = not crouching if crouching then CrouchButton.Text = "Stand" humanoid.WalkSpeed = humanoid.WalkSpeed / 2 -- Reduce walk speed when crouching humanoid.JumpPower = 0 humanoid.HipHeight = crouchingHeight else CrouchButton.Text = "Crouch" humanoid.WalkSpeed = humanoid.WalkSpeed * 2 -- restore walkspeed humanoid.JumpPower = 50 humanoid.HipHeight = standingHeight end end -- Button Clicked Event CrouchButton.MouseButton1Click:Connect(ToggleCrouch) -- Keybind (optional) UserInputService.InputBegan:Connect(function(input, gameProcessedEvent) if gameProcessedEvent then return end if input.KeyCode == Enum.KeyCode.C then -- Change "C" to your desired key ToggleCrouch() end end) -- Initial Setup (in case the character loads late) if character and humanoid then standingHeight = humanoid.HipHeight end player.CharacterAdded:Connect(function(char) character = char humanoid = character:WaitForChild("Humanoid") -- Wait for Humanoid to load, then get initial hip height humanoid.Loaded:Connect(function() standingHeight = humanoid.HipHeight end) end)