I am trying to access PlayerGui ingame so I can clone a frame into a Ui List Layout but it only works in studio. It uses a Remote Event but apparently it can’t find the Ui List Layout inside PlayerGui when ingame. Please help
Server Script:
remote = game.ReplicatedStorage.Error
Okay, and is the server the one distributing these notices, or the client? If you’re just trying to have a notice that is signaled by the client for the client, use a BindableEvent.
The thing is, I need to clone a frame into a GUI but when I clone into startergui, it doesnt appear and when I clone into playergui, it appears in studio but not ingame since PlayerGui doesnt replicate
Okay, so have the server send a notice message to the client as a string via FireClient, and then the client takes this message and generates the object with the text. I think you might be misunderstanding the server-client model here a bit.
Storing stuff in the Lighting is like, so 2011. The server does not need to be involved with the GUI objects at all. Store these objects in a LocalScript, have the server tell the client what notification to show if it needs to, and then the client deals with the rest.
Okay back up a little here. You seem to be rushing into this concept faster than you can understand it. It’s a bit more complicated than that.
The StarterGui is not where you should be cloning to. The StarterGui stores the initial ScreenGuis that will be cloned into each players PlayerGui.
So just as a simple rundown:
Make sure you’re using a LocalScript. Regular scripts will not run in guis.
Assuming you’re running the script inside of a GUI, get a variable that refers to your notification container by traversing through parents until you reach a common ancestor that both the container and the script share
Go through the children (via WaitForChild for safety) to access the notification container.