So, this error popped up on a script that i wrote
Workspace.Model.EventLister:20: attempt to index upvalue 'AlarmSound1' (a nil value)
I'm not sure what it means. Might be because i'm Dutch.
So, this is the simple script:
local AlarmSound1 = script.Parent:FindFirstChild("LockdownAlarm1")
local AlarmSound2 = script.Parent:FindFirstChild("LockdownAlarm2")
local AlarmSound3 = script.Parent:FindFirstChild("LockdownAlarm3")
local AlarmSound4 = script.Parent:FindFirstChild("LockdownAlarm4")
local AlarmSound5 = script.Parent:FindFirstChild("LockdownAlarm5")
--script.Parent.AlarmLight1.Light.LockdownAlarm1:Play() -- **THIS WORKED**
SetOn.Event:Connect(function()
wait()
AlarmSound1:Play() --** AND HERE COMES THE ERROR**
AlarmSound2:Play()
AlarmSound3:Play()
AlarmSound4:Play()
AlarmSound5:Play()
FadeOnLights()
repeat
wait()
until AlarmSound1.TimePosition >= 2
FadeOnLights()
repeat
wait()
until AlarmSound1.TimePosition >= 4
FadeOnLights()
repeat
wait()
until AlarmSound1.TimePosition >= 6
FadeOnLights()
end)
Any best man who could explain me what i'm doing wrong? Yes, i really need 5 sounds :-).
Edit: Added Local in front to the FindFirstChild's. Is this good or bad?
Edit 2: Replacing FindFirstChild for WaitForChild gives this error:
Infinite yield possible on 'Workspace.Model:WaitForChild("LockdownAlarm1")'
Edit 3: changed :WaitForChild("LockdownAlarm1") to :WaitForChild("LockdownAlarm1", true)
But, nothing happens. The script stops running after line 9 (where it's going to look for Lockdownalarm1). Also, the event won't be triggered now.

2 comments
'script.Parent:FindFirstChild("LockdownAlarm1")' does not exist. This could be because the script executes that chunk of code before that object loads in. Try waiting for the object with WaitForChild instead.
It already has to wait quiete long before it gets activated. Also, WaitForChild gives also an error (See my post, edited it)