Gui opening and closing?
Asked by
8 years ago Edited 8 years ago
When i am in roblox studios just testing it, it works. But in the actual game it does not. I have tried multiple ways of fixing it but failed to figure it out. Here is my code.
01 | ButtonGuiScript = script.Parent.ButtonGuiScript |
03 | GUI = script.Parent.Parent |
04 | MainMenuButton = Frame.MainMenuButton |
05 | MainMenuFrame = script.Parent.Parent:FindFirstChild( 'MainMenuFrame' ) |
06 | StartScreenbutton = Frame.StartScreenButton |
07 | StartScreenFrame = script.Parent.Parent:FindFirstChild( 'StartScreenFrame' ) |
08 | Inventorybutton = Frame.InventoryButton |
09 | InventoryFrame = script.Parent.Parent:FindFirstChild( 'InventoryFrame' ) |
12 | function MainMenubuttonClicked() |
14 | script.Parent.Parent:FindFirstChild( 'MainMenuFrame' ).Visible = true |
17 | function StartScreenbuttonClicked() |
19 | script.Parent.Parent:FindFirstChild( 'StartScreenFrame' ).Visible = true |
22 | function InventorybuttonClicked() |
24 | script.Parent.Parent:FindFirstChild( 'InventoryFrame' ).Visible = true |
27 | Inventorybutton.MouseButton 1 Click:connect(InventorybuttonClicked) |
28 | MainMenuButton.MouseButton 1 Click:connect(MainMenubuttonClicked) |
29 | StartScreenbutton.MouseButton 1 Click:connect(StartScreenbuttonClicked) |
I am getting the following errors inside roblox
- MainMenuButton is not a valid member of frame.
stack begin
script 'Players.jo3thebomb.PlayerGui.MainScreenGui.ButtonScreenFrame.ButtonGuiScript'.
stack end
-InventoryCloseButton is not a valid member of frame.
stack begin
script 'Players.jo3thebomb.PlayerGui.MainScreenGui.InventoryFrame.InventoryGuiScript'. -
stack end
-ShopButton is not a valid member of frame.
stack begin
script 'Players.jo3thebomb.PlayerGui.MainScreenGui.MainMenuFrame.MainMenuScript'. -
stack end