-
What do you want to achieve? Keep it simple and clear!
I am making a script where an npc follows the player based on the distance between the npc and the player’s hrp - What is the issue? Include screenshots / videos if possible!
local hrp = character.HumanoidRootPart.CFrame.Position
local aihrp = ai.Parent.HumanoidRootPart.CFrame.Position
dist = (hrp - aihrp).Magnitude
the code is under a while loop so it should update it, printing the hrp position seems normal but after the player resets/respawned the hrp position stays at the place where the player has died.
i have looked everywhere for a solution but i cant seem to find the right answer.