The following script works fine; but it constantly prints "yes" over and over. I would like to just print once if within the area, and just print "no" once if not in the area.
local player = game.Players.LocalPlayer
local render = game:GetService("RunService")
local work = game.Workspace
render.RenderStepped:connect(function()
if (player.Character.Head.Position - work.shopTouch.Position).magnitude < 5 then
print("yes")
else
print("no")
end
end)

1 comment
Are you sure using renderstepped is the best option? Something simpler like a while loop could be better for performance.