✓ Accepted answer
"Elseif" is a term used in if statements to define what will happen if the conditions of the first if statement are not met. The problem here is that you do not use elseif! You use if twice, making to if statements! The reasons this is the problem is because when the script runs, it will check if open is false. If it is false, then it will make open true. But then it runs the second if statement, because the script considers the two if statements as separate! By the time the second if statement is run, open is true, and since open is true, the second if statement makes open false. It will always become false again. An easy way to fix that is to change "if" to "elseif".
local Open = false
function Click()
wait()
if Open == false then
Open = true
script.Parent.Parent.Open.Transparency = 0
script.Parent.Parent.Closed.Transparency = 1
wait()
elseif Open == true then
Open = false
script.Parent.Parent.Open.Transparency = 1
script.Parent.Parent.Closed.Transparency = 0
end
wait()
end
script.Parent.ClickDetector.MouseClick:connect(Click)
If you found my answer helpful, you can upvote and accept it. If you have any questions, just ask and I will edit my response accordingly.