Hi , im very new to scripting, but there seem to be a promblem to what i did, im practicing my coding skill by making something, so i got an idea, i want to do a UI where you click the button, then the UI (GUI) appears, and if you click the button again, the UI or GUI, Dissapear, Then if you click it again ,it appears and so on, here's what i got :
local Mainframe = script.Parent.Parent.Mainframe
if Mainframe.Visible == false then
script.Parent.MouseButton1Click:Connect(function()
Mainframe.Visible = true
end)
end
if Mainframe.Visible == true then
script.Parent.MouseButton1Click:Connect(function()
Mainframe.Visible = false
end)
end
Mainframe.Changed:Connect(function()
if Mainframe.Visible == true then
script.Parent.MouseButton1Click:Connect(function()
Mainframe.Visible = false
end)
end
end)
Mainframe.Changed:Connect(function()
if Mainframe.Visible == false then
script.Parent.MouseButton1Click:Connect(function()
Mainframe.Visible = true
end)
end
end)
Even tho i command the code to check if the mainframe changed, it still doesnt work
Backpack Mainframe Somestuff InventoryButton LocalScript <--- where the script above is

2 comments
Let me know if this answer solved your question. c:
Hey, very detailed mate! You put so much effort into that! I respect you :)