local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local hrp = character:WaitForChild("HumanoidRootPart") local cam = workspace.CurrentCamera local uis = game:GetService("UserInputService") local runService = game:GetService("RunService") local debris = game:GetService("Debris") humanoid.CameraOffset = Vector3.new(0, 0, 0) humanoid.AutoRotate = true humanoid.RequiresNeck = false uis.InputChanged:Connect(function() if cam.CameraSubject == humanoid and cam.FieldOfView <= 70 then for _, part in pairs(character:GetChildren()) do if part:IsA("BasePart") then part.LocalTransparencyModifier = 0 end end end end) local gui = Instance.new("ScreenGui", game.CoreGui) gui.ResetOnSpawn = false local function makeButton(name, text, pos) local b = Instance.new("TextButton", gui) b.Name = name b.Size = UDim2.new(0, 100, 0, 40) b.Position = pos b.Text = text b.Font = Enum.Font.SourceSansBold b.TextSize = 18 b.TextColor3 = Color3.new(1, 1, 1) b.BackgroundColor3 = Color3.fromRGB(70, 70, 70) Instance.new("UICorner", b).CornerRadius = UDim.new(0, 8) return b end local sprintBtn = makeButton("Sprint", "Sprint", UDim2.new(1, -230, 1, -100)) local crouchBtn = makeButton("Crouch", "Crouch", UDim2.new(1, -120, 1, -160)) local crouchAnim = Instance.new("Animation") crouchAnim.AnimationId = "rbxassetid://287325678" local crouchTrack local sprinting = false local crouching = false local sprintSpeed = 25 local sprintTimer = 0 local tripReady = false local bumpCooldown = false local originalSizes = {} local function shrinkChar() for _, part in character:GetChildren() do if part:IsA("BasePart") and (part.Name:find("Torso") or part.Name == "HumanoidRootPart") then originalSizes[part] = part.Size part.Size = part.Size * Vector3.new(1, 0.5, 1) end end for _, part in character:GetChildren() do if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then part.CanCollide = false end end end local function restoreChar() for part, size in pairs(originalSizes) do if part then part.Size = size end end for _, part in character:GetChildren() do if part:IsA("BasePart") then part.CanCollide = true end end end local function updateMovement() if sprinting then humanoid.WalkSpeed = sprintSpeed sprintBtn.BackgroundColor3 = Color3.fromRGB(30, 30, 30) crouchBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 70) if crouchTrack then crouchTrack:Stop() end restoreChar() elseif crouching then humanoid.WalkSpeed = 10 crouchBtn.BackgroundColor3 = Color3.fromRGB(30, 30, 30) sprintBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 70) crouchTrack = humanoid:LoadAnimation(crouchAnim) crouchTrack:Play() shrinkChar() else humanoid.WalkSpeed = 16 sprintBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 70) crouchBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 70) if crouchTrack then crouchTrack:Stop() end restoreChar() end end sprintBtn.MouseButton1Click:Connect(function() if not sprinting then sprinting = true crouching = false else sprinting = false end sprintSpeed = 25 sprintTimer = 0 updateMovement() end) crouchBtn.MouseButton1Click:Connect(function() if not crouching then crouching = true sprinting = false else crouching = false end updateMovement() end) runService.RenderStepped:Connect(function(dt) if sprinting then sprintTimer += dt if sprintTimer >= 1 and sprintSpeed < 40 then sprintSpeed += 1 sprintTimer = 0 humanoid.WalkSpeed = sprintSpeed end end end) hrp.Touched:Connect(function(hit) if not hit:IsDescendantOf(character) and not bumpCooldown then bumpCooldown = true local tilt = Instance.new("BodyGyro", hrp) tilt.MaxTorque = Vector3.new(400000, 0, 400000) tilt.CFrame = hrp.CFrame * CFrame.Angles(0, 0, math.rad(math.random(-20, 20))) debris:AddItem(tilt, 0.3) if sprinting and sprintSpeed >= 40 then local bv = Instance.new("BodyVelocity", hrp) bv.MaxForce = Vector3.new(1e5, 0, 1e5) bv.Velocity = -hrp.CFrame.LookVector * 30 debris:AddItem(bv, 0.2) humanoid:ChangeState(Enum.HumanoidStateType.FallingDown) end wait(0.4) bumpCooldown = false end end) player.CharacterAdded:Connect(function(char) character = char humanoid = char:WaitForChild("Humanoid") hrp = char:WaitForChild("HumanoidRootPart") sprinting, crouching = false, false sprintSpeed = 25 sprintTimer = 0 updateMovement() end)