I made an NPC that follows you to kill you, but when you kill it, you respawn, and ten seconds later he respawns, but he stops following you. I think it has to do with the game.Players.PlayerAdded function but that is the only way I know. The script is inside the NPC
game.Players.PlayerAdded:Connect(function(p) p.CharacterAdded:Connect(function(char) while true do wait(0.1) if p:DistanceFromCharacter(script.Parent.HumanoidRootPart.Position) < 90 then script.Parent.Humanoid:MoveTo(char.HumanoidRootPart.Position) end end end) end)
function ready(tmp_plr) game:GetService("RunService").Stepped:connect(function() local yes, error = ypcall(function() if (math.abs((tmp_plr.Character.Head.Position-script.Parent.Head.Position).magnitude)) < 90) then script.Parent.Humanoid:MoveTo(tmp_plr.Character.Head.Position) end end) end) end game.Players.PlayerAdded:Connect(function(p) ready(p) end)