#How do I prevent the ragdoll freeze frame?

1 messages · Page 1 of 1 (latest)

cedar jetty
#

I've tried to make everyone be able to see the ragdoll instantly like in games like JJS or TSB, but it always has a freeze frame on both players and dummies. It only looks normal on the person that was ragdolled.

vestal shardBOT
#

studio** You are now Level 4! **studio

cedar jetty
#

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)