I only want the body parts of the npc to disappear so that the scripts i plan on adding will continue to run but the body parts won't disappear?
--//Variables
local hum = script.Parent:WaitForChild('Humanoid')
--//Died
hum.Died:Connect(function()
for i,v in pairs(script.Parent:GetChildren()) do
if v then
local bodyPart = v:FindFirstChildOfClass('Part')
if bodyPart then
bodyPart:Destroy()
end
end
end
end)

4 comments
Instead of using FindFirstChildOfClass, i used IsA and it worked.
Delete the question then
It told me not to delete it incase people in the future also have the same problem that i do.
Sorukan is right. All too often people are deleting their questions once they have found a solution to their problem. This makes the solution they received unavailable to others who might just have the same issue they were having. Questions should never have to be deleted and should be kept for archival purposes.