I am trying to make an AI enemy respawn when the player dies, the script that Ihave isn't working, I get no errors.
plr = game.Players.LocalPlayer char = plr.Character z = script.Parent backup = z:clone() while true do wait(5) if char.Humanoid.Health == 0 then print("ded") z:Remove() wait(2) backup.Parent = game.Workspace backup.Head:MakeJoints() backup.Torso:MakeJoints() if z == nil then wait(4) backup.Parent = game.Workspace backup.Head:MakeJoints() backup.Torso:MakeJoints() end end end