This is my first time messing with GUIs for quite a while, so I apologize in advance if the solution is something simple. I am currently working on an inventory and shop GUI. Inside of both of the screen GUIs I have a button named open, A scrolling frame and a local script which is the main controller for the GUI. Inside of both scripts I have the following code:
script.Parent.open.MouseButton1Click:connect(function() UpdateInventory() end)
Update inventory being the main function for the GUI (opening, closing etc). Now when I play the game everything works fine and dandy, it opens the GUI and lists objects you can buy or objects currently in your backpack. Now the problem comes when I create a test server or test the game outside of studio. The inventory GUI works quite well, what doesn't work is the shop GUI, even though it shares the same exact script for when the button is pressed. I get an error in the console stating: open is not a valid member of ScreenGui. Even though in the explorer you can clearly see open as a child of the screen GUI. While I was trying to debug this I created a script that prints off the children of the screen GUI, and sure enough, open was listed. Now I have a few questions if anyone wants to answer them. Why is this error happening? Why does the inventory GUI not suffer the same problem? And how should I go about fixing this?