I have a script to despawn an npc after it dies but it does nothing Here is the code:
robot = script.Parent.Robot
if robot.Health <= 0 then
script.Parent:Destroy()
end
BTW, Robot is just humanoid but it is renamed. Also the script is a child of the NPC. & finally, the NPC is a sort of 'zombie' that attacks the player so there are multiple clones of it in the map as well, just in case that messes anything up.

2 comments
K thanks for the answer, & yeah sorry I didn't realise that I wrote the title like that.
No problem :) title just confused me while scrolling past so thought I'd let you know