I've made a code that operates from one button, but it doesn't work, can you identify it?
local light1 = script.Parent.Parent.L1.SpotLight
local light2 = script.Parent.Parent.L2.SpotLight
function onClicked(mouse)
if light1.Enabled == false and light2.Enabled == false then
light1.Enabled = true
light2.Enabled = true
light1.Transparency = 1
light2.Transparency = 1
end
if light1.Enabled == true and light2.Enabled == true then
light1.Enabled = false
light2.Enabled = false
light1.Transparency = 0
light2.Transparency = 0
end
end
script.Parent.ClickDetector.MouseButton1Click:connect(onClicked)
