i have tried this
local PlayerToNpcDistanceX = (HRP.HumanoidRootPart.Position.X - NPCHRP.Position.X)
local PlayerToNpcDistanceZ = (HRP.HumanoidRootPart.Position.Z - NPCHRP.Position.Z)
local PosX
local PosZ
if PlayerToNpcDistanceX > 0 then
PosX = Vector3.new(HRP.HumanoidRootPart.Position.X + 5)
end
if PlayerToNpcDistanceZ > 0 then
PosZ = Vector3.new(HRP.HumanoidRootPart.Position.Z + 5)
end
if PlayerToNpcDistanceX < 0 then
PosX = Vector3.new(HRP.HumanoidRootPart.Position.X - 5)
end
if PlayerToNpcDistanceZ < 0 then
PosZ = Vector3.new(HRP.HumanoidRootPart.Position.Z - 5)
end
--local PlayerToNpcDistanceZ = (HRP.HumanoidRootPart.Position.z - NPCHRP.Position.Z).Unit * 5
print(PosX)
print(PosZ)
local MoveTo = Vector3.new(PosX, NPCHRP.Position.Y, PosZ)
Humanoid:MoveTo(MoveTo)
print("LEFT")
didnt work any ideas/help u can give