✓ Accepted answer
local NPC = script.Parent
local NPC2 = NPC:Clone()
NPC.Humanoid.Died:connect(function()
NPC2.Parent = game.Workspace
wait(0.5)
NPC:remove()
end)
A Humanoid.Died function can tell if the player has died or not, by doing this you can do many things like kicking them from the game, respawning, giving an award, taking away leaderstats, and much more...
I see in yours that you tried the same function..
One more thing, there's an output in studio, it helps debug scripts. To access it, simply go to the view tab and click on output.
Change the script how you like it, and remember, enjoy!
I hope you learned something.
2 comments
Thank you it works. But I need there to be a 15 seconds timer for the Regeneration. I edited wait (0.5) to wait (15) but it did nothing.
Here is the Noob. http://www.roblox.com/Noob-item?id=173807792