How would I make everything in a folder happen at once?

local Alarms = game.Workspace.Alarms
local strobeimage = game.Workspace.Alarms.FireAlarm.Strobe.Flasher.Strobe
local strobelight = game.Workspace.Alarms.FireAlarm.Strobe.Light
local IsPlayingAlarms = false

function onMouseClick()
	if (IsPlayingAlarms) then return end -- Check if alarms are already playing.

	for i, FireAlarm in pairs(Alarms:GetChildren()) do
		coroutine.resume(coroutine.create(function() -- Thread the effects.
			FireAlarm.horn.Sound:Play() -- Sound the alarm.
			
			while (IsPlayingAlarms) -- Strobe effect until IsPlayingAlarms = false
				wait(1)
				strobeimage.Visible = true
				strobelight.Enabled = true
				wait(0.1)
				strobelight.Enabled = false
				strobeimage.Visible = false
		end

		
		FireAlarm.horn.Sound:Stop()
		strobelight.Enabled = false
		strobeimage.Visible = false
	end))
	end
	end

Yes?

Oh wait, I forgot the “do” haha.

while (IsPlayingAlarms) do

Sorry, I know multiple programming languages. Others don’t use “do”.

It still seems to not be working, nothing seems to be working now…?

Add print("Alarm running") under the the while (IsPlayingAlarms) do line. Check if it’s even running.

EDIT: Also, check if strobeimage is pointing to anything. Shouldn’t it be FireAlarm.Strobe.Flasher

while (IsPlayingAlarms) -- Strobe effect until IsPlayingAlarms = false
   wait(1)
   FireAlarm.Strobe.Flasher.Visible = true
   FireAlarm.Strobe.Light.Enabled = true
   wait(0.1)
   FireAlarm.Strobe.Flasher.Visible = false
   FireAlarm.Strobe.Light.Enabled = false
end

Remember to change them at the end of the coroutine as well.