✓ Accepted answer
I am gonna start of first on why it errored, The reason it errored is because you asking the visible property of a ScreenGui (see the error), but you ScreenGui doesnt have a visible property but it does have an Enabled property who does the similar, Secondly from further inspecting your code, its most like you because you accidently forgot to wrote .Frame in you first event.
Secondly you should use Visible instead of visible since it is deprecated
(in case both are refering to the same TextLabel)
Thirdly you code doenst do what you think it does atm what it does is fire both functions: it sets Visible prop to true and to false, what you probably want it do is when its visible you want it to become invisble and when its visible you want to make it invisible
script.Parent.MouseButton1Down:Connect(function()
script.Parent.Parent.Frame.Visible = not script.Parent.Parent.Frame.Visible
end)
so the above sets the current bool of Visible to the oposite, so when u click it sets it to Visible to false and when u click once more it sets it to true, etc...
(in case they arent reffering to the same TextLabel)
then all you have to do is fix the first function
script.Parent.MouseButton1Down:Connect(function()
script.Parent.Parent.Frame.Visible = false
end)
1 comment
Tysm, it works now!