LightSystem=script.Parent Lights=LightSystem.Lights Switch=LightSystem.Button Switch1=Switch.Button1 Switch2=Switch.Button2 on=false children=Lights:GetChildren()function onClicked()if on==false then on=true Switch1.Transparency=0 Switch2.Transparency=1 for o=1,#children,1 do children[o].PointLight.Enabled=true print("\076\105\103\104\116\115 \079\110")end elseif on==true then on=false Switch1.Transparency=1 Switch2.Transparency=0 for o=1,#children,1 do children[o].PointLight.Enabled=false print("\076\105\103\104\116\115 \079\102\102")end end end Switch.ClickDetector.MouseClick:connect(onClicked)
-- Light System.

LightSystem = script.Parent -- Hello, Variables here
Lights = LightSystem.Lights
Switch = LightSystem.Button
Switch1 = Switch.Button1
Switch2 = Switch.Button2

on = false

children = Lights:GetChildren()

function onClicked()
	if on == false then
		on = true
		Switch1.Transparency = 0
		Switch2.Transparency = 1
		for i = 1, #children do
			children[i].PointLight.Enabled = true
			print("Lights On")
		end
	elseif on == true then
		on = false
		Switch1.Transparency = 1
		Switch2.Transparency = 0
		for i = 1, #children do
			children[i].PointLight.Enabled = false
			print("Lights Off")
		end
	end
end

Switch.ClickDetector.MouseClick:connect(onClicked)
