--[[
Note to self replace this with a general 
function in the main server later



]]

wait(1);
local TS = game.TweenService;
local R = Random.new(tick()*os.time());

local OnTime = {5,10};
local WaitTime = {5,10}; -- Time between turning on


local N = script.Parent.Parent.Neon;
local A = script.Parent;
function Start ()

	N.A1.A.Enabled = true;
	A.Alarm:Play();
	N.A1.Light.Enabled = true;
	wait(2);
	N.A1.Glow.Enabled = true;
	wait(1);
	A.Alarm:Stop();
	A.Start:Play();
	N.A4.Smoke.Enabled = true;

	
	
	spawn(function ()
		wait(3.0);
		A.Mid:Play();
	end);
	wait(1.5);
	N.A1.BLaser1.Enabled = true;
	N.A1.BLaser2.Enabled = true;
	
	for i, child in pairs(N.A3:GetChildren()) do
		child.Enabled = true;
	end 

end

function Spin ()
	
end

function Update ()
	
	
	-- Spin
	
end

function End ()
	
	
	A.Alarm:Play();
	A.End:Play();
	
	wait(0.2);
	A.Mid:Stop();
	wait(0.5);
	A.Alarm:Stop();
	
	N.A1.Light.Enabled = false;
	N.A4.Smoke.Enabled = false;
	N.A1.A.Enabled = false;
	N.A1.Glow.Enabled = false;
	N.A1.BLaser1.Enabled = false;
	N.A1.BLaser2.Enabled = false;
	
	for i, child in pairs(N.A3:GetChildren()) do
		child.Enabled = false;
	end 	
	
end


wait(4);
while true do
	
	local Total = R:NextNumber(OnTime[1], OnTime[2]);
	
	Start ();
	
	for i = 0, Total, 1 do
		Update();
		wait(1);
	end
	End();
	wait(R:NextNumber(WaitTime[1], WaitTime[2]));
end
