#How do I prevent the ragdoll freeze frame?
1 messages · Page 1 of 1 (latest)
** You are now Level 4! **
The code is too long for discord
This is the localscript:
local Character: Model = script.Parent.Parent
local Torso: BasePart = Character:WaitForChild("Torso")
local Humanoid: Humanoid = Character:WaitForChild("Humanoid")
local function push()
Torso:ApplyImpulse(Torso.CFrame.LookVector * -100)
end
local function GetRagdollState() return Character:GetAttribute("Ragdoll") end
Character:GetAttributeChangedSignal("Ragdoll"):Connect(function()
if (Humanoid.Health == 0) then
Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
push()
return
end
if GetRagdollState() then
Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
push()
elseif not GetRagdollState() then
Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
end)
Humanoid.Died:Connect(push)