Hi.
I have experienced the error in the title But it has a PointLight. It keeps registering it's not there.
Here is my code.
function gen.flicker(lightP)
local info = TweenInfo.new(0.2, Enum.EasingStyle.Elastic, Enum.EasingDirection.InOut, 1, false)
local on = gen.tweenServ:Create(lightP.PointLight, info, {Brightness = 1})
local off = gen.tweenServ:Create(lightP.PointLight, info, {Brightness = 0})
off:Play()
off.Completed:Wait()
lightP.Material = 'Glass'
on:Play()
on.Completed:Wait()
lightP.Material = 'Neon'
off:Play()
off.Completed:Wait()
lightP.Material = 'Glass'
on:Play()
on.Completed:Wait()
lightP.Material = 'Neon'
off:Play()
off.Completed:Wait()
lightP.Material = 'Glass'
on:Play()
on.Completed:Wait()
lightP.Material = 'Neon'
end
function gen.blackout(room)
local lamps = room.Assets.Lamps:GetChildren()
for _, lamp in ipairs(lamps) do
for _, obj in ipairs(lamp:GetChildren()) do
if obj.Name == 'Shade' then
task.spawn(function()
gen.flicker(obj)
end)
end
end
end
end

2 comments
the line that is causing the problem is line 3
:WaitForChild() is your best friend, try it