Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does my NPC not fall thru the floor?

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

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()

This discussion is preserved as it was. New answers, comments, and votes are closed.