Am I missing Something?

Im a new scripter and I just encountered something that can most likely be fixed by changing one small thing.

script

-- variables -------------------------------------------------------------------------------
local button = script.Parent
local button2 = script.Parent.Parent

function newgui()
	wait(0.03) -- tester
	button.Visible = false
	button2.Visible = true
	

end

 button.MouseButton1Click:Connect(newgui) -- when the button is clicked, run the function newgui

The green block is supposed to disappear when the red button is clicked. but it doesn’t work. The red button gets clicked and. disappears (as it should) but the green block is unaffected

Explorer window
Screen Shot 2023-08-03 at 9.47.12 PM

helps me pls

1 Like

GUI elements inherit visibility from their parent, so you need to make the two buttons separate, so one is not the parent of the other. Otherwise it wont be possible to hide the parent button without hiding the child one.

1 Like

sorry 4 my terrible thinking. its my second day on studio

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.