I have a script that makes it so when you click a text button, it activates and deactivates the parent of the text button (Which is a frame) However, when it's pressed, it doesn't work again. How can I fix it?
Here is my code:
Book = script.Parent Frame = Book.Parent function onClick() if Frame.BackgroundTransparency == 1 then Frame.BackgroundTransparency = 0 end if Frame.BackgroundTransparency == 0 then Frame.BackgroundTransparency = 1 end end Book.MouseButton1Click:connect(onClick)
Put you an else that way if its not anything else would be that
if Frame.BackgroundTransparency == 1 then Frame.BackgroundTransparency = 0 else Frame.BackgroundTransparency = 1 end