Alternative of while true do wait()?

I currently am using a while true do loop to check if Part A is near Part B

while (partA is not near partB) do
wait()
end

I have multiple of these loops and I’m worried it may cause performance issues.
Is there a more efficient way to do this?

repeat wait() until a is near b
runService.HeartBeat:Connect(abfunction)

1 Like

RunService events are more reliable or event-based waits or connections.