Whenever I try it in test mode, it works just fine. Except whenever I try it in game, it fails. I have no clue why.
local Button = script.Parent Frame = script.Parent.Parent.Frame function onClick() if Frame.Visible == false then Frame.Visible = true elseif Frame.Visible == true then Frame.Visible = false end end Button.MouseButton1Click:connect(onClick)
Layout - http://prntscr.com/gp3wya
Here. I fixed it.
local Button = script.Parent Frame = script.Parent.Parent.Frame local toggle = false script.Parent.MouseButton1Click:Connect(function() if toggle == false then Frame.Visible = true toggle = true else Frame.Visible = false toggle = false end)