Humanoid.HealthChanged:Connect(function(I)if I<=0 then script.Parent.HumanoidRootPart.Anchored=true DeathAnimation:Play()wait(.9)for I,B in pairs(NPC:GetDescendants())do if B:IsA("\080\097\114\116")or B:IsA("\066\097\115\101\080\097\114\116")or B:IsA("\077\101\115\104\080\097\114\116")or B:IsA("\068\101\099\097\108")then local I=TweenService:Create(B,TweenInfo.new(.4),{Transparency=1})I:Play()end end wait(.5)NPC:Remove()wait(4)newNPC.Parent=game.Workspace end end)

Humanoid.HealthChanged:Connect(function(Health) 
	if Health <= 0 then
		
		script.Parent.HumanoidRootPart.Anchored = true
		DeathAnimation:Play() 
		
		wait(0.9) --Aquí colocar tiempo para que empieze a desaparecer el NPC
		
		for i, v in pairs( NPC:GetDescendants()) do
			
			if v:IsA("Part") or v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("Decal") then
				local deathFade = TweenService:Create(v, TweenInfo.new(0.4), {Transparency = 1})
				deathFade:Play()
			end
		end
		
		wait(0.5)
		NPC:Remove()
		
		wait(4) --Aquí colocar tiempo para que el NPC haga respawn
		
		newNPC.Parent = game.Workspace
	end
end)
