I’m making a game called ruins, but for some reason, my collection service flickering lights is bugging and it’s only flickering once! It only prints 1 light on the output, here’s my code:
local CollectionService = game:GetService("CollectionService")
function CheckFlickerSoundFinish(FlickerSound)
FlickerSound.Ended:Connect(function()
FlickerSound:Destroy()
end)
end
while true do
for i, Light in ipairs(CollectionService:GetTagged("Flickering Light")) do
local FlickerSound = Instance.new("Sound", Light)
FlickerSound.SoundId = "rbxassetid://4288784832"
FlickerSound:Play()
task.spawn(CheckFlickerSoundFinish, FlickerSound)
print(Light)
for i = 1, 3 do
Light.Light.Enabled = false
task.wait(0.1)
Light.Light.Enabled = true
task.wait(0.1)
end
Light.Light.Enabled = true
task.wait(3)
end
end```