So i’m trying to make a stupid respawn script for my mob, but guess what, it doesn’t work =)
Why? I don’t know. It prints "Died." but stops printing after the wait(5).
I don’t see anything wrong with the script. I tried different types of respawn scripts. I even took the one from my other game (which was working) but not on this dummy.
Note: my dummy is R6. (Idk if that matters, but there you go)
Instead of Copy.Parent = NPC.Parent make Copy.Parent = NPC
and where is the Parent of Copy:MakeJoints()?
I dont understand ur Code what are u trying to do
local Copy = script.Parent:Clone()
local NPC = script.Parent
local Humanoid = NPC:WaitForChild("Humanoid")
while wait(0.001) do
if Humanoid.Health == 0 then
print("Died.")
wait(5)
Copy:Destroy()
end
end
If the humanoid gets deleted then the script will break, you could connect to both the Died event and the Destroying events to account for any mob death!