What do you want to achieve and What is the issue? (Check Image) Imagine that those Yellow Dots are buttons and each one opens a GUI… What could I do so that when I open one gui, the previous gui that was opened closes and the new one opens? Need help with this, please…
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried asking in some Roblox Discord servers that have people who helps with scripts and that stuff but i wasn’t lucky…
Image
Was using this simple code but it doesn’t work for what i want to achieve…
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Parent.Button.Visible = not script.Parent.Parent.Parent.Button.Visible
end)
script.Parent.MousButton1Click:Connect(function()
for i, v in ipairs([GUI]:GetChildren) do
if v.Enabled then not v.Enabled
end
end
script.Parent.Enabled = true
end)
wait I messed up on something, but I could explain it, when the yellow button is clicked I use a for loop which goes through everything inside the Gui that you want (change it if you didn’t know that) and then I check if v(the item) is enabled and if it is, I disable it change it to v.enabled = false and then after the for loop is finished I set the GUI that you want to enabled since we don’t want it to be disabled again in the for loop I 'll send sen an actaully working version with comments if you didn’t get that
script.Parent.MousButton1Click:Connect(function()
for i, v in ipairs([GUI]:GetChildren) do -- loop through everything inisde the parent of the gui that you might want to close
if v.Enabled then -- check if it's enabled
v.Enabled = false -- if it is disable it
end
end
[gui that you want to open].enabled = true -- open it after the for loop so it doesn't get disabled by it
end)