Why this wont work?(i tried both local script and script)
function OnClicked()
on = 1
if on == 1 then
on = 0
script.Parent.Parent.Frame.Visible = false
end
if on == 0 then
on = 1
script.Parent.Parent.Frame.Visible = true
end
end
script.Parent.MouseButton1Click:connect(OnClicked)

5 comments
dont work either
hmm let me try this in studio
huh, I just don't get it. Why would a generic function work rather than a regular one?
not sure why but it just works
It works because your "on" variable is being stored in your script environment rather than being reset every time the button is clicked.