Advertisement
Guest User

Npc respawn script

a guest
Dec 4th, 2022
762
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. local Copy = script.Parent:Clone()
  2. local NPC = script.Parent
  3. local Humanoid
  4. for i,v in pairs(NPC:GetChildren()) do
  5. if v:IsA('Humanoid') then
  6. Humanoid = v
  7. end
  8. end
  9.  
  10. if Humanoid then
  11. Humanoid.Died:Connect(function()
  12. wait(5)
  13. Copy.Parent = NPC.Parent
  14. Copy:MakeJoints()
  15. NPC:Destroy()
  16. end)
  17. else
  18. warn('Cannot find Humanoid in Respawn Script!')
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement