Joemamahacks

Npc Respawn

Apr 26th, 2024
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1. local respawnTime = 3
  2.  
  3. local function respawnNPC()
  4.     local npcClone = script.Parent:Clone()
  5.     npcClone.Parent = workspace
  6.     npcClone:SetPrimaryPartCFrame(CFrame.new(Vector3.new(0, 5, 0)))
  7.     npcClone.Humanoid.Health = npcClone.Humanoid.MaxHealth
  8. end
  9.  
  10. script.Parent.Humanoid.Died:Connect(function()
  11.     wait(3)
  12.     respawnNPC()
  13. end)
  14.  
Add Comment
Please, Sign In to add comment