local Players = game:GetService("Players") local RunService = game:GetService("RunService") local LP = Players.LocalPlayer local PS = LP:WaitForChild("PlayerScripts") local NORMAL_SPEED = 16 local NORMAL_JUMP = 50 local MAX_SAFE_SPEED = 55 local MAX_UPWARD_Y = 60 local MAX_DOWNWARD_Y = -120 local function getControls() local pm = PS:FindFirstChild("PlayerModule") if not pm then return nil end return require(pm):GetControls() end local function clearRagdoll(char) for _,v in ipairs(char:GetDescendants()) do if v:IsA("BallSocketConstraint") or v:IsA("HingeConstraint") then v:Destroy() elseif v:IsA("Motor6D") then v.Enabled = true end end end RunService.Heartbeat:Connect(function() local char = LP.Character if not char then return end local hum = char:FindFirstChildOfClass("Humanoid") local root = char:FindFirstChild("HumanoidRootPart") if not hum or not root then return end local controls = getControls() if controls then controls:Enable() end hum.PlatformStand = false hum.AutoRotate = true hum.Sit = false if hum.WalkSpeed < NORMAL_SPEED then hum.WalkSpeed = NORMAL_SPEED end if hum.JumpPower < NORMAL_JUMP then hum.JumpPower = NORMAL_JUMP end hum:ChangeState(Enum.HumanoidStateType.Running) clearRagdoll(char) local vel = root.AssemblyLinearVelocity local y = vel.Y if y > MAX_UPWARD_Y then y = MAX_UPWARD_Y elseif y < MAX_DOWNWARD_Y then y = MAX_DOWNWARD_Y end if Vector3.new(vel.X,0,vel.Z).Magnitude > MAX_SAFE_SPEED then local mv = hum.MoveDirection root.AssemblyLinearVelocity = Vector3.new( mv.X * hum.WalkSpeed, y, mv.Z * hum.WalkSpeed ) else root.AssemblyLinearVelocity = Vector3.new(vel.X, y, vel.Z) end end)