I'm making a gui in a way like lumber tycoon 2, you click menu and more options come up. Anyways i'm working on the first tab out of 5 and when i run the script everything works fine, i click U (to pop up the frame that is holding all the text buttons which are like 'Controls', 'Inventory' ect. And then when i click on the "Controls" text button which is supposed to make the Controls frame visible but then i come up with an error. I'll post the script and error.
local Button = script.Parent.Parent.Controls local Frame = script.Parent.Parent.ControlsFrame Button.MouseButton1Click:connect(function() ControlsFrame.Visible = true end)
And here's the error.
06:18:24.858 - Players.Player1.PlayerGui.MenuGui.MenuFrame.Controls.LocalScript:5: attempt to index global 'ControlsFrame' (a nil value)
You set it to Frame
, not ControllsFrame
.
local Button = script.Parent.Parent.Controls local Frame = script.Parent.Parent.ControlsFrame Button.MouseButton1Click:connect(function() Frame.Visible = true -- here end)