For some reason which I don't know of, this loop is not working properly?
local follow = script.Parent.Parent.Parent.Range.Target.Value local home = script.Parent.Parent.Parent.Range.Position while wait(.1) do if follow ~= "home" then local Position = game.Workspace:FindFirstChild(follow).Torso.Position script.Parent:MoveTo(Position) else script.Parent:MoveTo(home) end end
Is the value meant to change after the loop has began running? If so, then that would be your problem. The script will cache the "follow" value, meaning that if it changes at any point, the script will still use the old value. Change the follow variable to the instance StringValue and change the stuff in the "if" to "follow.Value"
local follow = script.Parent.Parent.Parent.Range.Target local home = script.Parent.Parent.Parent.Range.Position while wait(.1) do if follow.Value ~= "home" then local Position = game.Workspace:FindFirstChild(follow.Value).Torso.Position script.Parent:MoveTo(Position) else script.Parent:MoveTo(home) end end