So I'm trying to make a popup menu button but this script doesn't seem to work!
I made sure that everything was in the right place as well.
local Button = script.Parent
local Frame = script.Parent.Parent.Frame
Frame.Visible = false
function onClick()
if Frame.Visible == false then
Frame.Visible = true
elseif Frame.Visible == true then
Frame.Visible = false
end
end
Button.MouseButton1Click:Connect(onClick)
What's the issues with this script?

4 comments
use the not operator instead of using if statements
also use local variables
he is using local variables
the function isnt local