✓ Accepted answer
We create a variable outside of the event function that we can use to check inside the function while we wait those 30 seconds
local position
while Receptor.Parent~=workspace do wait() end
Receptor.Union:GetPropertyChangedSignal("Position"):Connect(function()
if Receptor.Union.Position==position then return end
position=Receptor.Union.Position
local n=0
repeat n=n+1 wait(1) until n>=30 or position~=Receptor.Union.Position
if position==Receptor.Union.Position then
end
end)
The script above is if it a server script, if it were a localscript, as im assuming since your checking something in the playergui I'd add a check alongside the first if statement like so
local position
while Receptor.Parent~=workspace do wait() end
Receptor.Union:GetPropertyChangedSignal("Position"):Connect(function()
if Receptor.Union.Position==position and game.Players.LocalPlayer.PlayerGui.Menu.Frame.Frame.Visible == true then return end
position=Receptor.Union.Position
local n=0
repeat n=n+1 wait(1) until n>=30 or position~=Receptor.Union.Position
if position==Receptor.Union.Position then
end
end)