Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why won't the server detect my GUI?

```
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!

1 answer

The reason the server isn't finding your GUI is that children of PlayerGui are generally not replicated to the server. Any code that attempts to access / manipulate a user's interface should be run in a local script.

2 comments

0

I am running a part of it in server for anti-exploiting remoteevents

0

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.