i'm making a gui that when you click a button it toggles another section of the gui on/off. here is the script
function leftClick(mouse) if script.Parent.Parent.DripColors.Visible == true then script.Parent.Parent.DripColors.Visible = false else script.Parent.Parent.DripColors.Visible = true end script.Parent.MouseButton1Click:connect(leftClick) end
1). all the locations are correct 2). I've tried using :WaitForChild() 3). I've Looked on the internet everywhere for the answer 4). Now i am asking this website 5). Please Help
Seems like a silly mistake. Your event connection is declared inside the function. Function never runs, so the connection is never made. Please correct:
function leftClick(mouse) if script.Parent.Parent.DripColors.Visible == true then script.Parent.Parent.DripColors.Visible = false else script.Parent.Parent.DripColors.Visible = true end end --here this line needs to be outside function script.Parent.MouseButton1Click:connect(leftClick)
I hope I helped.