I’m trying to make my GUI’s lock when one Mainframe is already open.
Example: if I open my shop mainframe and say I didn’t click exit and I go to click the “Codes Button” and it overlaps each other. How do I Prevent that?
This is my code:
--Variables--
local shopbutton,shopmainframe = script.Parent.ShopButton,script.Parent.ShopMainFrame
local codesbutton,codesmainframe = script.Parent.CodesButton,script.Parent.CodeMainFrame
--Functions--
shopbutton.MouseButton1Click:Connect(function()
shopmainframe:TweenPosition(UDim2.new(0.283, 0,0.065, 0)
)
end)
1 Like
You would need edit the Z-index for each GUI. The Z-index is a property of all the Guis. It basically means how many times it stacks on itself. So a gui with a Z-Index of 2 will go over another gui with a Z-index of 1.
4 Likes
You would have to either manually or automatically make the visible of all the children of a ScreenGUI to false. There are ways of doing this with if statements or other means. If you only want one GUI on at once, then this is the way to do it. Or if you don’t mind having more than one GUI, then what @Thereasonableplayer said also works.
2 Likes