
EnemyunitsConditions = function()
	EnemyInfUnit = { "e1", "e1", "e1", "e3", "dog"  }
	InfDelayTimemin = 5
	InfDelayTimemax = 7
	Trigger.AfterDelay(DateTime.Minutes(1), function()
		EnemyInfUnit = { "e1", "e1", "e2", "e3", "medi", "dog" }
		InfDelayTimemin = 3
		InfDelayTimemax = 6
		EngyDelayTimemin = 45
		EngyDelayTimemax = 90
		EnemyEngyIncome()
		if Map.LobbyOption("difficulty") ~= "easy" then
			EnemyMonsterUnit = { "PVICE", "BSPI" }
			MonsterDelayTimemin = 13
			MonsterDelayTimemax = 16
			EnemyMonsterIncome()
			EngyDelayTimemin = 30
			EngyDelayTimemax = 60
		end
	end)
	Trigger.AfterDelay(DateTime.Minutes(2), function()
		EnemyInfUnit = { "e1", "e2", "e3", "e4", "medi", "medi", "dog" }
		InfDelayTimemin = 2
		InfDelayTimemax = 4
		EnemyVehUnit = { "apc", "1tnk", "jeep", "ftrk" }
		VehDelayTimemin = 7
		VehDelayTimemax = 8
		EnemyVehicleIncome()
		EnemyMonsterUnit = { "PVICE", "IMP", "BSPI" }
	end)
	Trigger.AfterDelay(DateTime.Minutes(3), function()
		EnemyInfUnit = { "e1", "e2", "e3", "e4", "medi", "medi", "dog", "mech" }
		InfDelayTimemin = 1
		EnemyVehUnit = { "apc", "1tnk", "1tnk", "jeep", "ftrk" }
		VehDelayTimemin = 6
		VehDelayTimemax = 7
		MonsterDelayTimemin = 12
		MonsterDelayTimemax = 15
	end)
	Trigger.AfterDelay(DateTime.Minutes(4), function()
		EnemyMonsterUnit = { "PVICE", "IMP", "REVE", "BSPI" }
		VehDelayTimemin = 5
		VehDelayTimemax = 6
		EnemyTnkUnit = { "2tnk", "3tnk" }
		TnkDelayTimemin = 15
		TnkDelayTimemax = 18
		EnemyTnkIncome()
	end)
	Trigger.AfterDelay(DateTime.Minutes(5), function()
		EnemyInfUnit = { "e1", "e2", "e3", "e4", "medi", "medi", "medi", "dog", "mech", "mech" }
		EnemyArtyUnit = { "v2rl", "arty" }
		ArtyDelayTimemin = 12
		ArtyDelayTimemax = 20
		EnemyArtyIncome()
		EnemyHeliUnit = { "hind", "hind" }
		HeliDelayTimemin = 15
		HeliDelayTimemax = 20
		EnemyHeliIncome()
		if Map.LobbyOption("difficulty") == "hard" then
			EnemyUFOUnit = { "UFO.Beamer", "UFO.Laser" }
			UFODelayTimemin = 10
			UFODelayTimemax = 15
			EnemyUFOIncome()
			HeliDelayTimemin = 8
			HeliDelayTimemax = 15
			MonsterDelayTimemin = 9
			MonsterDelayTimemax = 14
		end
	end)
	Trigger.AfterDelay(DateTime.Minutes(6), function()
		EnemyInfUnit = { "e1", "e2", "e3", "e4", "medi", "medi", "dog", "mech", "mech", "shok" }
		EnemyHeliUnit = { "heli", "hind" }
		EnemyTnkUnit = { "2tnk", "3tnk", "ctnk", "4tnk" }
		EnemyMonsterUnit = { "PVICE", "IMP", "REVE", "BSPI", "PINKY" }
		TnkDelayTimemin = 12
		ArtyDelayTimemin = 10
		ArtyDelayTimemax = 18
	end)
	Trigger.AfterDelay(DateTime.Minutes(7), function()
		EnemyInfUnit = { "e1", "e2", "e3", "e4", "medi", "medi", "dog", "mech", "mech", "shok", "shok" }
		EnemyTnkUnit = { "2tnk", "3tnk", "ctnk", "ttnk", "4tnk" }
		EnemyMonsterUnit = { "PVICE", "IMP", "REVE", "BSPI", "PINKY", "MANC" }
		Demotruckincome()
	end)
	Trigger.AfterDelay(DateTime.Minutes(8), function()
		EnemyInfUnit = { "e1", "e2", "e3", "e4", "medi", "medi", "dog", "mech", "mech", "shok", "shok", "shok", "e7" }
		InfDelayTimemin = 1
		InfDelayTimemax = 5
		EnemyTnkUnit = { "2tnk", "3tnk", "ctnk", "ttnk", "ttnk", "4tnk", "4tnk" }
	end)
	Trigger.AfterDelay(DateTime.Minutes(9), function()
		EnemyVehUnit = { "apc", "1tnk", "1tnk", "jeep", "ftrk", "ftrk", "ftrk", "ftrk" }
		VehDelayTimemin = 4
		VehDelayTimemax = 5
	end)
	Trigger.AfterDelay(DateTime.Minutes(10), function()
	EnemyInfantryIncome()
	end)
end

EnemyInfantryIncome = function()
	AttackpathN = { CPos.New(4,11) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,15) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,7) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	AttackpathS = { CPos.New(4,44) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,40) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,48) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	RandomUnit = Utils.Random(EnemyInfUnit)
	EnemyUnitN = Actor.Create(RandomUnit, true, { Location = CPos.New(55,0) + CVec.New(0, Utils.RandomInteger(0, 25)), Owner = EnemysTop })
	EnemyUnitS = Actor.Create(RandomUnit, true, { Location = CPos.New(55,30) + CVec.New(0, Utils.RandomInteger(0, 25)), Owner = EnemysBottom })
	EnemyN = { EnemyUnitN }
	EnemyS = { EnemyUnitS }
	GroupPatrol(EnemyN, AttackpathN, DateTime.Seconds(0))
	GroupPatrol(EnemyS, AttackpathS, DateTime.Seconds(0))
	Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(InfDelayTimemin, InfDelayTimemax)), function()
		EnemyInfantryIncome()
	end)
end

EnemyVehicleIncome = function()
	AttackpathN = { CPos.New(4,11) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,15) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,7) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	AttackpathS = { CPos.New(4,44) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,40) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,48) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	RandomUnit = Utils.Random(EnemyVehUnit)
	EnemyUnitN = Actor.Create(RandomUnit, true, { Location = CPos.New(55,0) + CVec.New(0, Utils.RandomInteger(0, 25)), Owner = EnemysTop })
	EnemyUnitS = Actor.Create(RandomUnit, true, { Location = CPos.New(55,30) + CVec.New(0, Utils.RandomInteger(0, 25)), Owner = EnemysBottom })
	EnemyN = { EnemyUnitN }
	EnemyS = { EnemyUnitS }
	GroupPatrol(EnemyN, AttackpathN, DateTime.Seconds(0))
	GroupPatrol(EnemyS, AttackpathS, DateTime.Seconds(0))
	Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(VehDelayTimemin, VehDelayTimemax)), function()
		EnemyVehicleIncome()
	end)
end

EnemyTnkIncome = function()
	AttackpathN = { CPos.New(4,11) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,15) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,7) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	AttackpathS = { CPos.New(4,44) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,40) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,48) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	RandomUnit = Utils.Random(EnemyTnkUnit)
	EnemyUnitN = Actor.Create(RandomUnit, true, { Location = CPos.New(55,0) + CVec.New(0, Utils.RandomInteger(0, 25)), Owner = EnemysTop })
	EnemyUnitS = Actor.Create(RandomUnit, true, { Location = CPos.New(55,30) + CVec.New(0, Utils.RandomInteger(0, 25)), Owner = EnemysBottom })
	EnemyN = { EnemyUnitN }
	EnemyS = { EnemyUnitS }
	GroupPatrol(EnemyN, AttackpathN, DateTime.Seconds(0))
	GroupPatrol(EnemyS, AttackpathS, DateTime.Seconds(0))
	Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(TnkDelayTimemin, TnkDelayTimemax)), function()
		EnemyTnkIncome()
	end)
end

EnemyArtyIncome = function()
	AttackpathN = { CPos.New(4,11) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,15) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,7) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	AttackpathS = { CPos.New(4,44) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,40) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,48) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	RandomUnit = Utils.Random(EnemyArtyUnit)
	EnemyUnitN = Actor.Create(RandomUnit, true, { Location = CPos.New(55,0) + CVec.New(0, Utils.RandomInteger(0, 25)), Owner = EnemysTop })
	EnemyUnitS = Actor.Create(RandomUnit, true, { Location = CPos.New(55,30) + CVec.New(0, Utils.RandomInteger(0, 25)), Owner = EnemysBottom })
	EnemyN = { EnemyUnitN }
	EnemyS = { EnemyUnitS }
	GroupPatrol(EnemyN, AttackpathN, DateTime.Seconds(0))
	GroupPatrol(EnemyS, AttackpathS, DateTime.Seconds(0))
	Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(ArtyDelayTimemin, ArtyDelayTimemax)), function()
		EnemyArtyIncome()
	end)
end

EnemyHeliIncome = function()
	AttackpathN = { CPos.New(4,11) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,15) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,7) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	AttackpathS = { CPos.New(4,44) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,40) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,48) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	RandomUnit = Utils.Random(EnemyHeliUnit)
	EnemyUnitN = Actor.Create(RandomUnit, true, { Location = CPos.New(57,0) + CVec.New(0, Utils.RandomInteger(0, 25)), Owner = EnemysTop })
	EnemyUnitS = Actor.Create(RandomUnit, true, { Location = CPos.New(57,30) + CVec.New(0, Utils.RandomInteger(0, 25)), Owner = EnemysBottom })
	EnemyN = { EnemyUnitN }
	EnemyS = { EnemyUnitS }
	GroupPatrol(EnemyN, AttackpathN, DateTime.Seconds(0))
	GroupPatrol(EnemyS, AttackpathS, DateTime.Seconds(0))
	Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(HeliDelayTimemin, HeliDelayTimemax)), function()
		EnemyHeliIncome()
	end)
end

Demotruckincome = function()
	AttackpathN = { CPos.New(4,11) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,15) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,7) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	AttackpathS = { CPos.New(4,44) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,40) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,48) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(45, 100)), function()
		DemoN = Actor.Create("dtrk", true, { Location = CPos.New(55,5), Owner = EnemysTop })
		DemoS = Actor.Create("dtrk", true, { Location = CPos.New(55,50), Owner = EnemysBottom })
		DtrukN = { DemoN }
		DtrukS = { DemoS }
		MovePatrol(DtrukN, AttackpathN, DateTime.Seconds(0))
		MovePatrol(DtrukS, AttackpathS, DateTime.Seconds(0))
		Demotruckincome()
	end)
end


EnemyMonsterIncome = function()
	AttackpathN = { CPos.New(4,11) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,15) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,7) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	AttackpathS = { CPos.New(4,44) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,40) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,48) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	RandomUnit = Utils.Random(EnemyMonsterUnit)
	EnemyUnitN = Actor.Create(RandomUnit, true, { Location = CPos.New(55,0) + CVec.New(0, Utils.RandomInteger(0, 25)), Owner = EnemysTop })
	EnemyUnitS = Actor.Create(RandomUnit, true, { Location = CPos.New(55,30) + CVec.New(0, Utils.RandomInteger(0, 25)), Owner = EnemysBottom })
	EnemyN = { EnemyUnitN }
	EnemyS = { EnemyUnitS }
	GroupPatrol(EnemyN, AttackpathN, DateTime.Seconds(0))
	GroupPatrol(EnemyS, AttackpathS, DateTime.Seconds(0))
	Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(MonsterDelayTimemin, MonsterDelayTimemax)), function()
		EnemyMonsterIncome()
	end)
end

EnemyUFOIncome = function()
	AttackpathN = { CPos.New(4,11) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,15) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,7) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	AttackpathS = { CPos.New(4,44) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,40) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)), CPos.New(4,48) + CVec.New(Utils.RandomInteger(-3, 3), Utils.RandomInteger(-3, 3)) }
	RandomUnit = Utils.Random(EnemyUFOUnit)
	EnemyUnitN = Actor.Create(RandomUnit, true, { Location = CPos.New(57,0) + CVec.New(0, Utils.RandomInteger(0, 25)), Owner = EnemysTop })
	EnemyUnitS = Actor.Create(RandomUnit, true, { Location = CPos.New(57,30) + CVec.New(0, Utils.RandomInteger(0, 25)), Owner = EnemysBottom })
	EnemyN = { EnemyUnitN }
	EnemyS = { EnemyUnitS }
	GroupPatrol(EnemyN, AttackpathN, DateTime.Seconds(0))
	GroupPatrol(EnemyS, AttackpathS, DateTime.Seconds(0))
	Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(UFODelayTimemin, UFODelayTimemax)), function()
		EnemyUFOIncome()
	end)
end

GroupPatrol = function(units, waypoints, delay) 
	local i = 1
	local stop = false
	Utils.Do(units, function(unit)
		Trigger.OnIdle(unit, function()
			if stop then
				return
			end
			if unit.Location == waypoints[i] then
				local bool = Utils.All(units, function(actor) return actor.IsIdle end)
				if bool then
					stop = true
					i = i + 1
					if i > #waypoints then
						i = 1
					end
					Trigger.AfterDelay(delay, function() stop = false end)
				end
			else
				unit.AttackMove(waypoints[i])
			end
		end)
	end)
end

MovePatrol = function(units, waypoints, delay) 
	local i = 1
	local stop = false
	Utils.Do(units, function(unit)
		Trigger.OnIdle(unit, function()
			if stop then
				return
			end
			if unit.Location == waypoints[i] then
				local bool = Utils.All(units, function(actor) return actor.IsIdle end)
				if bool then
					stop = true
					i = i + 1
					if i > #waypoints then
						i = 1
					end
					Trigger.AfterDelay(delay, function() stop = false end)
				end
			else
				unit.Move(waypoints[i])
			end
		end)
	end)
end

Actors1 = { "q1d01", "q1d01", "q1d05", "q1d05", "q1d05", "q1d03" }

countH1 = 0
countV1 = 0
countH2 = 0
countH3 = 0
countV3 = 0
GroundMaker = function()
	if countV1 < 22 then
		if countH1 < 22 then
			newactor = Actor.Create("q1d08", true, { Location = CPos.New(0,-2) + CVec.New(countH1, countV1), Owner = France })
			newactor = Actor.Create("q1d11", true, { Location = CPos.New(0,34) + CVec.New(countH1, countV1), Owner = France })
			countH1 = countH1 + 5
		elseif countH1 > 22 then
			RandomActor1 = Utils.Random(Actors1)
			RandomActor2 = Utils.Random(Actors1)
			newactor = Actor.Create(RandomActor1, true, { Location = CPos.New(0,-2) + CVec.New(countH1, countV1), Owner = France })
			newactor = Actor.Create(RandomActor2, true, { Location = CPos.New(0,34) + CVec.New(countH1, countV1), Owner = France })
			countH1 = countH1 + 5
			if countH1 > 55 then
				countV1 = countV1 + 5
				countH1 = 0
			end
		
		end
		GroundMaker()
	end
	if countH2 < 15 then
		newactor = Actor.Create("nix03", true, { Location = CPos.New(0,26) + CVec.New(countH2, 0), Owner = France })
		newactor = Actor.Create("nix03", true, { Location = CPos.New(0,28) + CVec.New(countH2, 0), Owner = France })
	end
	if countH2 < 45 then
		newactor = Actor.Create("q1d12", true, { Location = CPos.New(0,23) + CVec.New(countH2, 0), Owner = France })
		newactor = Actor.Create("q1d12", true, { Location = CPos.New(0,31) + CVec.New(countH2, 0), Owner = France })
		countH2 = countH2 + 3
	end
	if countV3 < 13 then
		newactor = Actor.Create("q1d12", true, { Location = CPos.New(45,23) + CVec.New(countH3, countV3), Owner = France })
		countH3 = countH3 + 3	
		if countH3 > 10 then
			countH3 = 0
			if countV3 < 6 or countV3 > 6 then
				countV3 = countV3 + 3
			elseif countV3 == 6 then
				countV3 = countV3 + 2
			end
		end
	end
end

RemoveMap = function()	
	allactors = France.GetActors()
	for i,v in pairs(allactors) do
			v.Destroy()
	end
end
		


MCVincome = function()
	newmcv0 = Actor.Create("fact", true, { Location = CPos.New(8,7), Owner = Multi0 })
	Trigger.OnKilledOrCaptured(newmcv0, function() Multi0.MarkFailedObjective(KillbaseP1) end)
	newmcv1 = Actor.Create("fact", true, { Location = CPos.New(8,15), Owner = Multi1 }) 
	Trigger.OnKilledOrCaptured(newmcv1, function() Multi1.MarkFailedObjective(KillbaseP2) end)
	newmcv2 = Actor.Create("fact", true, { Location = CPos.New(8,40), Owner = Multi2 })
	Trigger.OnKilledOrCaptured(newmcv2, function() Multi2.MarkFailedObjective(KillbaseP3) end)
	newmcv3 = Actor.Create("fact", true, { Location = CPos.New(8,48), Owner = Multi3 })
	Trigger.OnKilledOrCaptured(newmcv3, function() Multi3.MarkFailedObjective(KillbaseP4) end)
	Team1Mainbases = { newmcv0, newmcv1 }
	Team2Mainbases = { newmcv2, newmcv3 }
	Trigger.OnAllKilledOrCaptured(Team1Mainbases, Team2Won)
	Trigger.OnAllKilledOrCaptured(Team2Mainbases, Team1Won)

	newoil0 = Actor.Create("oilb", true, { Location = CPos.New(21,8), Owner = Multi0 })
	newoil0 = Actor.Create("oilb", true, { Location = CPos.New(30,8), Owner = Multi0 }) 
	newoil1 = Actor.Create("oilb", true, { Location = CPos.New(21,14), Owner = Multi1 })
	newoil1 = Actor.Create("oilb", true, { Location = CPos.New(30,14), Owner = Multi1 })
	newoil0 = Actor.Create("oilb", true, { Location = CPos.New(21,41), Owner = Multi2 })
	newoil0 = Actor.Create("oilb", true, { Location = CPos.New(30,41), Owner = Multi2 }) 
	newoil1 = Actor.Create("oilb", true, { Location = CPos.New(21,47), Owner = Multi3 })
	newoil1 = Actor.Create("oilb", true, { Location = CPos.New(30,47), Owner = Multi3 })

	newEnemymcv0 = Actor.Create("fact", true, { Location = CPos.New(51,7), Owner = EnemysTop })
	newEnemymcv1 = Actor.Create("fact", true, { Location = CPos.New(51,15), Owner = EnemysTop }) 
	newEnemymcv2 = Actor.Create("fact", true, { Location = CPos.New(51,40), Owner = EnemysBottom })
	newEnemymcv3 = Actor.Create("fact", true, { Location = CPos.New(51,48), Owner = EnemysBottom })
	newEnemyhpad0 = Actor.Create("hpad", true, { Location = CPos.New(47,7), Owner = EnemysTop })
	newEnemyhpad1 = Actor.Create("hpad", true, { Location = CPos.New(47,15), Owner = EnemysTop }) 
	newEnemyhpad2 = Actor.Create("hpad", true, { Location = CPos.New(47,40), Owner = EnemysBottom })
	newEnemyhpad3 = Actor.Create("hpad", true, { Location = CPos.New(47,48), Owner = EnemysBottom })
	newEnemyapwr1 = Actor.Create("much.apwr", true, { Location = CPos.New(50,11), Owner = EnemysTop })
	newEnemyapwr2 = Actor.Create("much.apwr", true, { Location = CPos.New(50,44), Owner = EnemysBottom })
	Team1Enemybases = { newEnemymcv0, newEnemymcv1, newEnemyhpad0, newEnemyhpad1, newEnemyapwr1 }
	Team2Enemybases = { newEnemymcv2, newEnemymcv3, newEnemyhpad2, newEnemyhpad3, newEnemyapwr2 }
	Trigger.OnAllKilledOrCaptured(Team1Enemybases, Team1Won)
	Trigger.OnAllKilledOrCaptured(Team2Enemybases, Team2Won)
	newEnemytsla0 = Actor.Create("tsla", true, { Location = CPos.New(45,8), Owner = EnemysTop })
	newEnemytsla1 = Actor.Create("tsla", true, { Location = CPos.New(45,16), Owner = EnemysTop }) 
	newEnemytsla2 = Actor.Create("tsla", true, { Location = CPos.New(45,41), Owner = EnemysBottom })
	newEnemytsla3 = Actor.Create("tsla", true, { Location = CPos.New(45,49), Owner = EnemysBottom })
	newEnemypbox0 = Actor.Create("hbox", true, { Location = CPos.New(50,10), Owner = EnemysTop })
	newEnemypbox1 = Actor.Create("hbox", true, { Location = CPos.New(50,18), Owner = EnemysTop }) 
	newEnemypbox2 = Actor.Create("hbox", true, { Location = CPos.New(50,43), Owner = EnemysBottom })
	newEnemypbox3 = Actor.Create("hbox", true, { Location = CPos.New(50,51), Owner = EnemysBottom })
	if Map.LobbyOption("difficulty") ~= "easy" then
		newEnemy = Actor.Create("agun", true, { Location = CPos.New(49,7), Owner = EnemysTop })
		newEnemy = Actor.Create("agun", true, { Location = CPos.New(49,15), Owner = EnemysTop }) 
		newEnemy = Actor.Create("agun", true, { Location = CPos.New(49,40), Owner = EnemysBottom })
		newEnemy = Actor.Create("agun", true, { Location = CPos.New(49,48), Owner = EnemysBottom })
		newEnemytsla0 = Actor.Create("tsla", true, { Location = CPos.New(46,8), Owner = EnemysTop })
		newEnemytsla1 = Actor.Create("tsla", true, { Location = CPos.New(46,16), Owner = EnemysTop }) 
		newEnemytsla2 = Actor.Create("tsla", true, { Location = CPos.New(46,41), Owner = EnemysBottom })
		newEnemytsla3 = Actor.Create("tsla", true, { Location = CPos.New(46,49), Owner = EnemysBottom })
	end
	if Map.LobbyOption("difficulty") == "hard" then
		newEnemy = Actor.Create("agun", true, { Location = CPos.New(53,6), Owner = EnemysTop })
		newEnemy = Actor.Create("agun", true, { Location = CPos.New(53,14), Owner = EnemysTop }) 
		newEnemy = Actor.Create("agun", true, { Location = CPos.New(53,39), Owner = EnemysBottom })
		newEnemy = Actor.Create("agun", true, { Location = CPos.New(53,47), Owner = EnemysBottom })
		newEnemy = Actor.Create("gap", true, { Location = CPos.New(48,11), Owner = EnemysTop })
		newEnemy = Actor.Create("gap", true, { Location = CPos.New(48,44), Owner = EnemysBottom })
		newEnemytsla0 = Actor.Create("tsla", true, { Location = CPos.New(44,8), Owner = EnemysTop })
		newEnemytsla1 = Actor.Create("tsla", true, { Location = CPos.New(44,16), Owner = EnemysTop }) 
		newEnemytsla2 = Actor.Create("tsla", true, { Location = CPos.New(44,41), Owner = EnemysBottom })
		newEnemytsla3 = Actor.Create("tsla", true, { Location = CPos.New(44,49), Owner = EnemysBottom })
	end
end


SetupPlayers = function()
	EnemysTop = Player.GetPlayer("EnemysTop")
	EnemysBottom = Player.GetPlayer("EnemysBottom")
	France = Player.GetPlayer("france")
	Neutral = Player.GetPlayer("Neutral")
	Multi0 = Player.GetPlayer("Multi0")
	if Multi0 == nil then
		Multi0 = Player.GetPlayer("Multi1")
		if Multi0 == nil then
			Multi0 = Player.GetPlayer("Creeps")
		end
	end
	Multi1 = Player.GetPlayer("Multi1")
	if Multi1 == nil then
		Multi1 = Player.GetPlayer("Multi0")
		if Multi1 == nil then
			Multi1 = Player.GetPlayer("Creeps")
		end
	end
	Multi2 = Player.GetPlayer("Multi2")
	if Multi2 == nil then
		Multi2 = Player.GetPlayer("Multi3")
		if Multi2 == nil then
			Multi2 = Player.GetPlayer("Creeps")
		end
	end
	Multi3 = Player.GetPlayer("Multi3")
	if Multi3 == nil then
		Multi3 = Player.GetPlayer("Multi2")
		if Multi3 == nil then
			Multi3 = Player.GetPlayer("Creeps")
		end
	end
	humans = { Multi0, Multi1, Multi2, Multi3 }
end

Team1Won = function()
	Multi0.MarkCompletedObjective(KillbaseP1) 
	Multi1.MarkCompletedObjective(KillbaseP2)
	Multi2.MarkFailedObjective(KillbaseP3)
	Multi3.MarkFailedObjective(KillbaseP4)
end
Team2Won = function()
	Multi2.MarkCompletedObjective(KillbaseP3) 
	Multi3.MarkCompletedObjective(KillbaseP4)
	Multi0.MarkFailedObjective(KillbaseP1)
	Multi1.MarkFailedObjective(KillbaseP2)
end
SetCamera = function(Multi)
	local mainbase = Multi.GetActorsByType("fact")[1]
	Camera.Position = mainbase.CenterPosition
end

Light = 0

turnOn = function()
	Lighting.Ambient = Light
	if Light < 1 then
		Light = Light + 0.01
		Trigger.AfterDelay(1, function()
			turnOn()
		end)
	end
end

PlaySound = function()
	Media.PlaySound("Dark.wav")
	Trigger.AfterDelay(DateTime.Seconds(200), PlaySound)
end

GiveMoney = function()
	if not newmcv0.IsDead and Multi0.Experience>0 then
		Multi0.Cash = Multi0.Cash + Multi0.Experience
		Media.FloatingText("" .. (Multi0.Experience) .. " $ Scorebonus", newmcv0.CenterPosition, 30, Multi0.Color)
	end
	if not newmcv1.IsDead and Multi1.Experience>0 then
		Multi1.Cash = Multi1.Cash + Multi1.Experience
		Media.FloatingText("" .. (Multi1.Experience) .. " $ Scorebonus", newmcv1.CenterPosition, 30, Multi1.Color)
	end
	if not newmcv2.IsDead and Multi2.Experience>0 then
		Multi2.Cash = Multi2.Cash + Multi2.Experience
		Media.FloatingText("" .. (Multi2.Experience) .. " $ Scorebonus", newmcv2.CenterPosition, 30, Multi2.Color)
	end
	if not newmcv3.IsDead and Multi3.Experience>0 then
		Multi3.Cash = Multi3.Cash + Multi3.Experience
		Media.FloatingText("" .. (Multi3.Experience) .. " $ Scorebonus", newmcv3.CenterPosition, 30, Multi3.Color)
	end
	Trigger.AfterDelay(DateTime.Seconds(3), function()
		GiveMoney()
	end)
end
BridgePathNorth = { CPos.New(43, 25), CPos.New(40, 25), CPos.New(37, 25), CPos.New(34, 25), CPos.New(31, 25), CPos.New(28, 25), CPos.New(25, 25), CPos.New(22, 25), CPos.New(19, 25), CPos.New(16, 25) }
BridgePathSouth = { CPos.New(43, 31), CPos.New(40, 31), CPos.New(37, 31), CPos.New(34, 31), CPos.New(31, 31), CPos.New(28, 31), CPos.New(25, 31), CPos.New(22, 31), CPos.New(19, 31), CPos.New(16, 31) }
EnemyEngyIncome = function()
	RandomUnit = Utils.Random(EnemyInfUnit)
	EnemyUnitN = Actor.Create("e6", true, { Location = CPos.New(55,27), Owner = EnemysTop })
	EnemyUnitS = Actor.Create("e6", true, { Location = CPos.New(55,28), Owner = EnemysBottom })
	EnemyN = { EnemyUnitN }
	EnemyS = { EnemyUnitS }
	MovePatrol(EnemyN, BridgePathNorth, DateTime.Seconds(0))
	MovePatrol(EnemyS, BridgePathSouth, DateTime.Seconds(0))
	Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(EngyDelayTimemin, EngyDelayTimemax)), function()
		EnemyEngyIncome()
	end)
end
TBridgebuilder1= { CPos.New(42, 25), CPos.New(43, 25), CPos.New(44, 25) }
TBridgebuilder2= { CPos.New(39, 25), CPos.New(40, 25), CPos.New(41, 25) }
TBridgebuilder3= { CPos.New(36, 25), CPos.New(37, 25), CPos.New(38, 25) }
TBridgebuilder4= { CPos.New(33, 25), CPos.New(34, 25), CPos.New(35, 25) }
TBridgebuilder5= { CPos.New(30, 25), CPos.New(31, 25), CPos.New(32, 25) }
TBridgebuilder6= { CPos.New(27, 25), CPos.New(28, 25), CPos.New(29, 25) }
TBridgebuilder7= { CPos.New(24, 25), CPos.New(25, 25), CPos.New(26, 25) }
TBridgebuilder8= { CPos.New(21, 25), CPos.New(22, 25), CPos.New(23, 25) }
TBridgebuilder9= { CPos.New(18, 25), CPos.New(19, 25), CPos.New(20, 25) }
TBridgebuilder10= { CPos.New(15, 25), CPos.New(16, 25), CPos.New(17, 25) }
BBridgebuilder1= { CPos.New(42, 31), CPos.New(43, 31), CPos.New(44, 31) }
BBridgebuilder2= { CPos.New(39, 31), CPos.New(40, 31), CPos.New(41, 31) }
BBridgebuilder3= { CPos.New(36, 31), CPos.New(37, 31), CPos.New(38, 31) }
BBridgebuilder4= { CPos.New(33, 31), CPos.New(34, 31), CPos.New(35, 31) }
BBridgebuilder5= { CPos.New(30, 31), CPos.New(31, 31), CPos.New(32, 31) }
BBridgebuilder6= { CPos.New(27, 31), CPos.New(28, 31), CPos.New(29, 31) }
BBridgebuilder7= { CPos.New(24, 31), CPos.New(25, 31), CPos.New(26, 31) }
BBridgebuilder8= { CPos.New(21, 31), CPos.New(22, 31), CPos.New(23, 31) }
BBridgebuilder9= { CPos.New(18, 31), CPos.New(19, 31), CPos.New(20, 31) }
BBridgebuilder10= { CPos.New(15, 31), CPos.New(16, 31), CPos.New(17, 31) }

SetBridgeTriggers = function()
	NIX1 = Actor.Create("nix03", true, { Location = CPos.New(42,26), Owner = France })
	Trigger.OnEnteredFootprint(TBridgebuilder1, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX1.Destroy()
				a.Owner = Neutral
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(42,26)), Owner = France })
			end)
		end
	end)
	NIX2 = Actor.Create("nix03", true, { Location = CPos.New(39,26), Owner = France })
	Trigger.OnEnteredFootprint(TBridgebuilder2, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX2.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(39,26)), Owner = France })
			end)
		end
	end)
	NIX3 = Actor.Create("nix03", true, { Location = CPos.New(36,26), Owner = France })
	Trigger.OnEnteredFootprint(TBridgebuilder3, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX3.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(36,26)), Owner = France })
			end)
		end
	end)
	NIX4 = Actor.Create("nix03", true, { Location = CPos.New(33,26), Owner = France })
	Trigger.OnEnteredFootprint(TBridgebuilder4, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX4.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(33,26)), Owner = France })
			end)
		end
	end)
	NIX5 = Actor.Create("nix03", true, { Location = CPos.New(30,26), Owner = France })
	Trigger.OnEnteredFootprint(TBridgebuilder5, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX5.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(30,26)), Owner = France })
			end)
		end
	end)
	NIX6 = Actor.Create("nix03", true, { Location = CPos.New(27,26), Owner = France })
	Trigger.OnEnteredFootprint(TBridgebuilder6, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX6.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(27,26)), Owner = France })
			end)
		end
	end)
	NIX7 = Actor.Create("nix03", true, { Location = CPos.New(24,26), Owner = France })
	Trigger.OnEnteredFootprint(TBridgebuilder7, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX7.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(24,26)), Owner = France })
			end)
		end
	end)
	NIX8 = Actor.Create("nix03", true, { Location = CPos.New(21,26), Owner = France })
	Trigger.OnEnteredFootprint(TBridgebuilder8, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX8.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(21,26)), Owner = France })
			end)
		end
	end)
	NIX9 = Actor.Create("nix03", true, { Location = CPos.New(18,26), Owner = France })
	Trigger.OnEnteredFootprint(TBridgebuilder9, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX9.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(18,26)), Owner = France })
			end)
		end
	end)
	NIX10 = Actor.Create("nix03", true, { Location = CPos.New(15,26), Owner = France })
	Trigger.OnEnteredFootprint(TBridgebuilder10, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX10.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(15,26)), Owner = France })
			end)
		end
	end)
	NIX11 = Actor.Create("nix03", true, { Location = CPos.New(42,28), Owner = France })
	Trigger.OnEnteredFootprint(BBridgebuilder1, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX11.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(42,28)), Owner = France })
			end)
		end
	end)
	NIX12 = Actor.Create("nix03", true, { Location = CPos.New(39,28), Owner = France })
	Trigger.OnEnteredFootprint(BBridgebuilder2, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX12.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(39,28)), Owner = France })
			end)
		end
	end)
	NIX13 = Actor.Create("nix03", true, { Location = CPos.New(36,28), Owner = France })
	Trigger.OnEnteredFootprint(BBridgebuilder3, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX13.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(36,28)), Owner = France })
			end)
		end
	end)
	NIX14 = Actor.Create("nix03", true, { Location = CPos.New(33,28), Owner = France })
	Trigger.OnEnteredFootprint(BBridgebuilder4, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX14.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(33,28)), Owner = France })
			end)
		end
	end)
	NIX15 = Actor.Create("nix03", true, { Location = CPos.New(30,28), Owner = France })
	Trigger.OnEnteredFootprint(BBridgebuilder5, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX15.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(30,28)), Owner = France })
			end)
		end
	end)
	NIX16 = Actor.Create("nix03", true, { Location = CPos.New(27,28), Owner = France })
	Trigger.OnEnteredFootprint(BBridgebuilder6, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX16.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(27,28)), Owner = France })
			end)
		end
	end)
	NIX17 = Actor.Create("nix03", true, { Location = CPos.New(24,28), Owner = France })
	Trigger.OnEnteredFootprint(BBridgebuilder7, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX17.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(24,28)), Owner = France })
			end)
		end
	end)
	NIX18 = Actor.Create("nix03", true, { Location = CPos.New(21,28), Owner = France })
	Trigger.OnEnteredFootprint(BBridgebuilder8, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX18.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(21,28)), Owner = France })
			end)
		end
	end)
	NIX19 = Actor.Create("nix03", true, { Location = CPos.New(18,28), Owner = France })
	Trigger.OnEnteredFootprint(BBridgebuilder9, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX19.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(18,28)), Owner = France })
			end)
		end
	end)
	NIX20 = Actor.Create("nix03", true, { Location = CPos.New(15,28), Owner = France })
	Trigger.OnEnteredFootprint(BBridgebuilder10, function(a, id) 
		if a.Type == "e6" and a.Owner ~= Neutral then
			Trigger.RemoveFootprintTrigger(id)
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				NIX20.Destroy()
				a.Owner = Neutral 
				if not a.IsDead then a.Kill() end
				Bridge1 = Actor.Create("q1d12", true, { Location = (CPos.New(15,28)), Owner = France })
			end)
		end
	end)
end

function WorldLoaded()
	Media.StopMusic()
	SetupPlayers()
	GroundMaker()
	SetBridgeTriggers()
	MCVincome()
	PlaySound()
	turnOn()
	EnemyunitsConditions()
	EnemyInfantryIncome()
	KillbaseP1 = Multi0.AddPrimaryObjective("Kill the top enemys Mainbase")
	KillbaseP2 = Multi1.AddPrimaryObjective("Kill the top enemys Mainbase")
	KillbaseP3 = Multi2.AddPrimaryObjective("Kill the bottom enemys Mainbase")
	KillbaseP4 = Multi3.AddPrimaryObjective("Kill the bottom enemys Mainbase")
	GiveMoney()
	Trigger.AfterDelay(1, function()
		if Multi0.IsLocalPlayer then
			SetCamera(Multi0)
		elseif Multi1.IsLocalPlayer then
			SetCamera(Multi1)
		elseif Multi2.IsLocalPlayer then
			SetCamera(Multi2)
		elseif Multi3.IsLocalPlayer then
			SetCamera(Multi3)
		end
	end)
	Trigger.AfterDelay(DateTime.Seconds(3), function() -- player announcements
		Media.DisplayMessage("Defend your bases against the incoming forces.")	
	end)
	Trigger.AfterDelay(DateTime.Seconds(8), function()
		Media.DisplayMessage("Try to destroy the enemys base.")
	end)
	Trigger.AfterDelay(DateTime.Seconds(15), function()
		Media.DisplayMessage("You can use engies to build bridges.")
	end)
end

