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)

2 comments
put a "print("Inside Function") or something of the sort to confirm the function is being run each time. Then it would have something to do with the code inside the function
use the print() method whenever possible, its extremely helpful when debugging.