--iiTiago <33333 IsOn = script.Parent.IsOn IsOn = true Black = script.Parent.Parent.Black Red = script.Parent.Parent.Red Close = script.Parent.Parent.Close Show = script.Parent.Parent.Show Black2 = script.Parent.Parent.Black2 function IsOn() if IsOn == true then print("Test") Black.Visible = false Red.Visible = false Close.Visible = false Show.Visible = true Black2.Visible = true IsOn = false print("ily") end end print("umg") function IsOff() if IsOn == false then Black.Visible = true Red.Visible = true Close.Visible = true Show.Visible = false Black2.Visible = false IsOn = true end end Close.MouseButton1Click:connect(IsOn) Show.MouseButton1Click:connect(IsOff)
My script isnt working how would i fix it? The script is meant to close when a button is clicked and open when a button is clicked. Surprisingly there is no errors in the output.
Your problem is you are trying to change the value of IsOn, but you are actually requesting to change IsOn, but not the value, to true or false.
--iiTiago <33333 IsOn = script.Parent.IsOn IsOn.Value = true Black = script.Parent.Parent.Black Red = script.Parent.Parent.Red Close = script.Parent.Parent.Close Show = script.Parent.Parent.Show Black2 = script.Parent.Parent.Black2 function On() --try coohing a diferent name for the function to avoid bugs if IsOn.Value == true then --you need to put .Value after all of the IsOns print("Test") Black.Visible = false Red.Visible = false Close.Visible = false Show.Visible = true Black2.Visible = true IsOn.Value = false print("ily") end end print("umg") function IsOff() if IsOn.Value == false then Black.Visible = true Red.Visible = true Close.Visible = true Show.Visible = false Black2.Visible = false IsOn.Value = true end end Close.MouseButton1Click:connect(On) Show.MouseButton1Click:connect(IsOff)