--create tables:

for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "a" then
		table.insert(a, 1, part)
	end
end
for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "b" then
		table.insert(b, 1, part)
	end
end

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

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

while true do

	lightOn(a)
	wait(0.15)

	lightOff(a)
	wait(0.04)

	lightOn(a)
	wait(0.15)

	lightOff(a)
	wait(0.1)
	
	lightOn(b)
	wait(0.15)

	lightOff(b)
	wait(0.04)
	
	lightOn(b)
	wait(0.15)

	lightOff(b)
	wait(0.1)
	
end

