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

Why does my NPC not fall thru the floor?

Asked by 3 years ago

As the title suggests, I am trying to make it so when the NPC's humanoid health hits 0, it falls thru the floor as break joins on death doesn't work for some reason???

while true do
    local target = findNearestPlayer(script.Parent.HumanoidRootPart.Position)
    if target ~= nil then
        script.Parent.Humanoid:MoveTo(target.Position, target)    
    else
        if script.Parent.Humanoid.Health == 0 then
            script.Parent.Head.CanCollide = false
            script.Parent.HumanoidRootPart.CanCollide = false
            script.Parent["Ignis Hitbox"].CanCollide = false
            script.Parent.Ignis1.CanCollide = false
            script.Parent.Ignis2.CanCollide = false
            script.Parent.Ignis3.CanCollide = false
            script.Parent.Ignis4.CanCollide = false
            script.Parent.Ignis5.CanCollide = false
            script.Parent.Ignis6.CanCollide = false
            script.Parent["Left Arm"].CanCollide = false
            script.Parent["Left Leg"].CanCollide = false
            script.Parent["Page Left"].CanCollide = false
            script.Parent["Page Right"].CanCollide = false
            script.Parent["Right Arm"].CanCollide = false
            script.Parent["Right Leg"].CanCollide = false
            script.Parent["Tome Left"].CanCollide = false
            script.Parent["Tome Right"].CanCollide = false
            script.Parent["Torso"].CanCollide = false    
            script.Parent.HumanoidRootPart.CanCollide = false
        end    
        end
end

1 answer

Log in to vote
0
Answered by 3 years ago

When answering, if your answer does not fully solve the question, it should be written as a comment to the question instead of as an answer.

CanCollide = false to true when it false your npc fall thru the floor when true it doesn't if you want breakjoint this code below:

script.Parent:BreakJoints()
Ad

Answer this question