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.
ButtonGuiScript = script.Parent.ButtonGuiScript
Frame = script.Parent
GUI = script.Parent.Parent
MainMenuButton = Frame.MainMenuButton
MainMenuFrame = script.Parent.Parent:FindFirstChild('MainMenuFrame')
StartScreenbutton = Frame.StartScreenButton
StartScreenFrame = script.Parent.Parent:FindFirstChild('StartScreenFrame')
Inventorybutton = Frame.InventoryButton
InventoryFrame = script.Parent.Parent:FindFirstChild('InventoryFrame')
function MainMenubuttonClicked()
wait(0.1)
script.Parent.Parent:FindFirstChild('MainMenuFrame').Visible = true
end
function StartScreenbuttonClicked()
wait(0.1)
script.Parent.Parent:FindFirstChild('StartScreenFrame').Visible = true
end
function InventorybuttonClicked()
wait(0.1)
script.Parent.Parent:FindFirstChild('InventoryFrame').Visible = true
end
Inventorybutton.MouseButton1Click:connect(InventorybuttonClicked)
MainMenuButton.MouseButton1Click:connect(MainMenubuttonClicked)
StartScreenbutton.MouseButton1Click: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

2 comments
It worked! Thank you so much! If there are any tutorials or anything i could get from you, Links anything. Pass me them! :)
If you'd click the Accept Answer button down below, That'd be greatly appericiated. :)