so, i was scripting and i noticed that it wanted me to put an end near "else", i tried doing that in many different ways and nothing worked. can someone help me out and correct my code?
script.Parent.MouseButton1Click:Connect(function() script.Parent.ColorGradientFrame.Visible = true script.Parent.ColorGradientFrame2.Visible = true script.Parent.DarknessGradientFrame.Visible = true script.Parent.DarknessGradientFrame2.Visible = true else script.Parent.ColorGradientFrame.Visible = false script.Parent.ColorGradientFrame2.Visible = false script.Parent.DarknessGradientFrame.Visible = false script.Parent.DarknessGradientFrame2.Visible = false end)
Your problem is that you used else with no if statement. Else should be used in situations where there are two possible outcomes that rely on a statement being true or false. I'm going to assume that you just want to make the color gradient visible and invisible per click. That would look like this:
script.Parent.MouseButton1Click:Connect(function() if not script.Parent.ColorGradient.Frame.Visible then script.Parent.ColorGradientFrame.Visible = true script.Parent.ColorGradientFrame2.Visible = true script.Parent.DarknessGradientFrame.Visible = true script.Parent.DarknessGradientFrame2.Visible = true else -- else means that any situation that the Frame isn't visible, the following lines will run script.Parent.ColorGradientFrame.Visible = false script.Parent.ColorGradientFrame2.Visible = false script.Parent.DarknessGradientFrame.Visible = false script.Parent.DarknessGradientFrame2.Visible = false end end)
Comment if you have any questions as to how that works. Hope I helped!