local RS = game:GetService("ReplicatedStorage")

script.Parent:WaitForChild("Faceling").Humanoid.Died:Connect(function()
	script.Parent.Faceling:Destroy() --Despawns the NPC model
	local Entity = RS.Entities.Faceling:Clone()
	Entity.Parent = script.Parent
	Entity:MoveTo(script.Parent.Position)

end)

Basically this checks if NPC dies and then clones new one from ReplicatedStorage, but for some reason this only works once and does not respawn after killing second time.

Would be glad if someone helps me out :), also I do not necessarily need fix and won't mind if someone gives me better way to respawn NPC to that location

3 comments

0

In title I meant second time it falls apart after dying and stays like that.

0

maybe try "while true do" it creates a loop so maybe it'll work

0

Solved, Thank you