for J,v in pairs(model:GetChildren())do if(string.sub(v.Name,1,1)=="\097"or string.sub(v.Name,1,1)=="\099")and v:IsA("\066\097\115\101\080\097\114\116")then table.insert(a,1,v)end end for J,v in pairs(model:GetChildren())do if(string.sub(v.Name,1,1)=="\098"or string.sub(v.Name,1,1)=="\099")and v:IsA("\066\097\115\101\080\097\114\116")then table.insert(b,1,v)end end function lightOn(J)for J,v in pairs(J)do v.SurfaceLight.Enabled=true if v:FindFirstChild("\083\112\111\116\076\105\103\104\116")then v.SpotLight.Enabled=true end end end function lightOff(J)for J,v in pairs(J)do v.SurfaceLight.Enabled=false if v:FindFirstChild("\083\112\111\116\076\105\103\104\116")then v.SpotLight.Enabled=false end end end function run()while on do lightOn(a)wait(.18)lightOff(a)wait(.04)lightOn(a)wait(.13)lightOff(a)wait(.03)lightOn(b)wait(.18)lightOff(b)wait(.04)lightOn(b)wait(.13)lightOff(b)wait(.03)end end script.Parent.RemoteEvent.OnServerEvent:Connect(function()if on==true then on=false else on=true run()end end)
--create tables:
for i, part in pairs(model:GetChildren()) do
	if (string.sub(part.Name, 1, 1) == "a" or string.sub(part.Name, 1, 1) == "c") and part:IsA("BasePart") then
		table.insert(a, 1, part)
	end
end
for i, part in pairs(model:GetChildren()) do
	if (string.sub(part.Name, 1, 1) == "b" or string.sub(part.Name, 1, 1) == "c") and part:IsA("BasePart") then
		table.insert(b, 1, part)
	end
end

function lightOn(T)
	for i, part in pairs(T) do
		part.SurfaceLight.Enabled = true
		if part:FindFirstChild("SpotLight") then
			part.SpotLight.Enabled = true
		end
	end
end

function lightOff(T)
	for i, part in pairs(T) do
		part.SurfaceLight.Enabled = false
		if part:FindFirstChild("SpotLight") then
			part.SpotLight.Enabled = false
		end
	end
end

function run()
	while on do
		lightOn(a)
		wait(0.18)

		lightOff(a)
		wait(0.04)

		lightOn(a)
		wait(0.13)

		lightOff(a)
		wait(0.03)

		lightOn(b)
		wait(0.18)

		lightOff(b)
		wait(0.04)

		lightOn(b)
		wait(0.13)

		lightOff(b)
		wait(0.03)
	end
end

script.Parent.RemoteEvent.OnServerEvent:Connect(function()
	if on == true then
		on = false
	else
		on = true
		run()
	end
end)
