Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I fix the mistakes I made in my code to make a player ragdoll upon damage being dealt?

Asked by 3 years ago
Edited 3 years ago

I am wondering where I made discrepancies and how I can fix them, (p.s. I started coding yesterday, so I am fairly new to this, therefore can you try to simplify any answers to the best of your abilities [where you can] thank you in advance.)

local Player = nil
local Parent = nil
local Humanoid = nil
Player = Player.Parent(function(death, event) 

end)

if Humanoid.CurrentHealth <  Humanoid.Health then
    Humanoid:SetRagdollEnabled(Enum.HumanoidRagdollPhysics.Dead, false)
end

if Humanoid.CurrentHealth ~=  Humanoid.Health then
    Humanoid:SetRagdollEnabled(Enum.HumanoidRagdollPhysics.Dead, false) 'false'

    --player wont ragdoll if no health is taken off

    if Humanoid:SetRagdollEnabled(Enum.HumanoidRagdollPhysics.Dead, false) then
        wait(2)
    elseif Humanoid:SetGettingUpEnabled(Enum.HumanoidGettingUpPhysics.Dead, false)then

        end

    end

I am trying to code it so when a player gets hurt, they ragdoll.

Answer this question