```
function RemoteEvents.PurchaseCrate.OnServerInvoke(player, cost)
local playergui = player:WaitForChild("PlayerGui")
local unbox = playergui:WaitForChild('Unbox'):WaitForChild('UnboxFrame')
end
```
Whenever I play, it says "playergui:WaitForChild('Unbox')" is an infinite yield even though it is clearly a member of my PlayerGui, help is appreciated!

2 comments
I am running a part of it in server for anti-exploiting remoteevents
In that case, do everything to do with the GUI on the client, then use a RemoteEvent/Function to send a message to do stuff on the server.