-- Anything parented to this script's parent will be lit up!

 
MaxFlickerWait = 30
MinFlickerWait = 10
Allow = false
function Change(Mode)
    for _,i in pairs (script.Parent:GetChildren()) do
        if i:IsA("BasePart") then
            if Mode then
                i.Material = "Neon"
            else
                i.Material = "SmoothPlastic"
            end
        elseif i:IsA("Model") then
            for _,i in pairs (i:GetChildren()) do
                if Mode then
                    i.Material = "Neon"
                else
                    i.Material = "SmoothPlastic"
                end
            end
        end
    end
end
script.On.Changed:connect(function()
    if script.On.Value then
        Allow = true
        Change(true)
    else
        Allow = false
        Change(false)
    end
end)
while wait(math.random(MinFlickerWait,MaxFlickerWait)) do
    if Allow then
        local function Check() if not Allow then return end end
        local WaitTime = .5
        Change(false)
        wait(WaitTime/2); Check();
        Change(true)
        wait(WaitTime); Check()
        Change(false)
        wait(WaitTime*1.5); Check()
        Change(true)
        wait(WaitTime); Check()
        Change(false)
        wait(WaitTime/5); Check()
        Change(true)
        wait(WaitTime); Check()
        Change(false)
        wait(WaitTime/8); Check()
        Change(true)
    end
end
