SetupPlayers = function()
	Neutral = Player.GetPlayer("Neutral")
	Multi0 = Player.GetPlayer("Multi0")
	if Multi0 == nil then
		Multi0 = Player.GetPlayer("Neutral")
	end
	Multi1 = Player.GetPlayer("Multi1")
	if Multi1 == nil then
		Multi1 = Player.GetPlayer("Neutral")
	end
	Multi2 = Player.GetPlayer("Multi2")
	if Multi2 == nil then
		Multi2 = Player.GetPlayer("Neutral")
	end
	Multi3 = Player.GetPlayer("Multi3")
	if Multi3 == nil then
		Multi3 = Player.GetPlayer("Neutral")
	end
end

Cratecontrol = function()
	Trigger.AfterDelay(DateTime.Seconds(55), function()
		Sendnormalcrate()
	end)
	Trigger.AfterDelay(DateTime.Seconds(330), function()
		Sendspecialcrate()
		Warningalert()
		Media.DisplayMessage("Okay guys it seems like the special crates will be dropped soon in mid!", "Materia", HSLColor.Red)
	end)
	Trigger.AfterDelay(DateTime.Seconds(530), function()
		Sendsupercrate()
		AlertStarts = false
		Warningalert()
		Media.DisplayMessage("Let the party begin the super crates get into the arena!", "Materia", HSLColor.Red)
	end)

end
AlertStarts = false
BlueLight = 1
GreenLight = 1

Warningalert = function()
	Lighting.Blue = BlueLight
	Lighting.Green = GreenLight
	if Lighting.Blue >= 1 and not AlertStarts then
		GettingRed = true
		Media.PlaySoundNotification( allplayers, "AlertBuzzer")
	end
	if BlueLight >= 0.2 and GettingRed then
		AlertStarts = true
		BlueLight = BlueLight - 0.05
		GreenLight = GreenLight - 0.05
		Trigger.AfterDelay(1, function()
			Warningalert()
		end)
	elseif BlueLight <= 1 then
		BlueLight = BlueLight + 0.05
		GreenLight = GreenLight + 0.05
		GettingRed = false
		Trigger.AfterDelay(1, function()
			Warningalert()
		end)
	end
end
Sendnormalcrate = function()
	DetonationPoint = Actor.Create("waypoint", true, { Location = CPos.New(43,43), Owner = Neutral })
	ParaProxy = Actor.Create("powerproxy.normalcrate", false, { Owner = Neutral })
	crates = ParaProxy.SendParatroopers(DetonationPoint.CenterPosition)
	Trigger.AfterDelay(DateTime.Seconds(80), function()
		Sendnormalcrate()
	end)
end

Sendspecialcrate = function()
	DetonationPoint = Actor.Create("waypoint", true, { Location = CPos.New(43,43), Owner = Neutral })
	ParaProxy = Actor.Create("powerproxy.specialcrate", false, { Owner = Neutral })
	crates = ParaProxy.SendParatroopers(DetonationPoint.CenterPosition)
	Trigger.AfterDelay(DateTime.Seconds(70), function()
		Sendspecialcrate()
	end)
end

Sendsupercrate = function()
	DetonationPoint = Actor.Create("waypoint", true, { Location = CPos.New(43,43), Owner = Neutral })
	ParaProxy = Actor.Create("powerproxy.supercrate", false, { Owner = Neutral })
	crates = ParaProxy.SendParatroopers(DetonationPoint.CenterPosition)
	Trigger.AfterDelay(DateTime.Seconds(60), function()
		Sendsupercrate()
	end)
end

Setteleporttriggers = function()
-- Topteleporter
	Trigger.OnEnteredFootprint({CPos.New(43,20)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(43, 29) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(43,19)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(43, 29) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(43,21)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(43, 29) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(42,20)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(43, 29) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(41,20)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(43, 29) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
-- Rightteleporter
	Trigger.OnEnteredFootprint({CPos.New(66,43)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(57, 43) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(65,43)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(57, 43) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(67,43)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(57, 43) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(66,42)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(57, 43) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(66,44)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(57, 43) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
-- Bottomteleporter
	Trigger.OnEnteredFootprint({CPos.New(43,66)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(43, 57) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(43,65)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(43, 57) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(43,67)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(43, 57) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(42,66)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(43, 57) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(41,66)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(43, 57) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
-- Leftteleporter
	Trigger.OnEnteredFootprint({CPos.New(20,43)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(29, 43) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(19,43)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(29, 43) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(21,43)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(29, 43) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(20,42)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(29, 43) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(20,41)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "mcv" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(29, 43) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
			end
		end
	end)
end

SetteleporttriggersInsideOut = function()
-- TopLeftteleporter
	Trigger.OnEnteredFootprint({CPos.New(36,36)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(30, 30) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(36,35)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(30, 30) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(36,37)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(30, 30) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(35,36)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(30, 30) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(37,36)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(30, 30) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)


-- Downleftteleporter


	Trigger.OnEnteredFootprint({CPos.New(36,50)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(30, 56) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(35,50)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(30, 56) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(37,50)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(30, 56) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(36,51)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(30, 56) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(36,49)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(30, 56) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)


-- Upperright


	Trigger.OnEnteredFootprint({CPos.New(50,36)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(56, 30) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(50,35)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(56, 30) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(50,37)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(56, 30) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(49,36)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(56, 30) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(51,36)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(56, 30) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)

-- Downrightteleporter

	Trigger.OnEnteredFootprint({CPos.New(50,50)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(56, 56) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(49,50)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(56, 56) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(51,50)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(56, 56) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(50,49)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(56, 56) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
	Trigger.OnEnteredFootprint({CPos.New(50,51)}, function(a, id)
		if a.Type == "allosaurusegg" or a.Type == "trexegg" or a.Type == "stegosaurusegg" or a.Type == "triceratopsegg" or a.Type == "brachiosaurusegg"or a.Type == "parasaurusegg" or a.Type == "gallimusegg" or a.Type == "biggun" or a.Type == "harv" or a.Type == "1tnk.husk" or a.Type == "2tnk.husk" or a.Type == "3tnk.husk" or a.Type == "4tnk.husk" or a.Type == "harv.fullhusk" or a.Type == "harv.emptyhusk" or a.Type == "mcv.husk" or a.Type == "mgg.husk" or a.Type == "camera"  or a.Type == "camera.paradrop"  or a.Type == "camera.spyplane" or a.MaxHealth == 17500 then
			return
		else
			if not a.IsDead and a.IsInWorld then
				a.Stop()
				a.Teleport(CPos.New(56, 56) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-1, 2)))
				Trigger.OnIdle(a, function()
					Trigger.ClearAll(a)
					if not a.IsDead and a.IsInWorld then a.Scatter() end
				end)
			end
		end
	end)
end


Northmove = { CPos.New(42,28), CPos.New(43,28), CPos.New(44,28), CPos.New(42,29), CPos.New(43,29), CPos.New(44,29), CPos.New(42,30), CPos.New(43,30), CPos.New(44,30) }

Rightmove = { CPos.New(56,42), CPos.New(57,42), CPos.New(58,42), CPos.New(56,43), CPos.New(57,43), CPos.New(58,43), CPos.New(56,44), CPos.New(57,44), CPos.New(58,44) }


Bottommove = { CPos.New(42,56), CPos.New(43,56), CPos.New(44,56), CPos.New(42,57), CPos.New(43,57), CPos.New(44,57), CPos.New(42,58), CPos.New(43,58), CPos.New(44,58) }

Leftmove = { CPos.New(28,42), CPos.New(29,42), CPos.New(30,42), CPos.New(28,43), CPos.New(29,43), CPos.New(30,43), CPos.New(28,44), CPos.New(29,44), CPos.New(30,44) }

Setmovetriggers = function()
-- Topteleporter
	Trigger.OnEnteredFootprint(Northmove, function(a, id)
		if a.HasProperty("Move") then
			a.Move(CPos.New(43, 33) + CVec.New(Utils.RandomInteger(-2, 3), Utils.RandomInteger(-1, 2)))
		end
	end)
-- Rightteleporter
	Trigger.OnEnteredFootprint(Rightmove, function(a, id)
		if a.HasProperty("Move") then
			a.Move(CPos.New(53, 43) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-2, 3)))
		end
	end)
-- Bottomteleporter
	Trigger.OnEnteredFootprint(Bottommove, function(a, id)
		if a.HasProperty("Move") then
			a.Move(CPos.New(43, 53) + CVec.New(Utils.RandomInteger(-2, 3), Utils.RandomInteger(-1, 2)))
		end
	end)
-- Leftteleporter
	Trigger.OnEnteredFootprint(Leftmove, function(a, id)
		if a.HasProperty("Move") then
			a.Move(CPos.New(33, 43) + CVec.New(Utils.RandomInteger(-1, 2), Utils.RandomInteger(-2, 3)))
		end
	end)
end
Notifications = function()
	Trigger.AfterDelay(DateTime.Seconds(1), function()
		Media.DisplayMessage("Hi, there are many new special crates in this map!", "Materia", HSLColor.Red)	
	end)
	Trigger.AfterDelay(DateTime.Seconds(6), function()
		Media.DisplayMessage("The special crates are only dropped in the middle!", "Materia", HSLColor.Red)
	end)
	Trigger.AfterDelay(DateTime.Seconds(11), function()
		Media.DisplayMessage("Step on the round teleporter next to your base to get into middle!", "Materia", HSLColor.Red)
		Media.PlaySoundNotification( allplayers, "Beacon")
		Showarrows()
	end)
	Trigger.AfterDelay(DateTime.Seconds(16), function()
		Media.DisplayMessage("gl hf", "Materia", HSLColor.Red)
	end)
end
Floatcount = 0
Showarrows = function()
	downarrow = Actor.Create("arrowdown", true, { Location = CPos.New(44,17), Owner = Neutral })
	leftarrow = Actor.Create("arrowleft", true, { Location = CPos.New(70,43), Owner = Neutral })
	uparrow = Actor.Create("arrowup", true, { Location = CPos.New(44,69), Owner = Neutral })
	rightarrow = Actor.Create("arrowright", true, { Location = CPos.New(18,43), Owner = Neutral })
	Trigger.AfterDelay(DateTime.Seconds(1), function()
		Floatcount = Floatcount + 1
		downarrow.Destroy()
		leftarrow.Destroy()
		uparrow.Destroy()
		rightarrow.Destroy()
		if Floatcount <= 12 then
			Trigger.AfterDelay(DateTime.Seconds(1), function()
				Showarrows()
			end)
		end
	end)
end

num = 0
function joinMyTables(t1, t2) -- simple join tables
	for k,v in ipairs(t2) do
		table.insert(t1, v)
		num = num + 1
	end 
	return t1
end
GetandsetFlags = function()
	CTFlags = {}
	Trigger.AfterDelay(DateTime.Seconds(1), function() -- set up Flags
		local neut = Player.GetPlayer("Neutral")
		for i=1,#CTFFLagtypes do
			local T1 = neut.GetActorsByType(CTFFLagtypes[i])
			if T1 ~= nil then
				joinMyTables(CTFlags, T1)			
			end
		end
	end)
	
	Trigger.AfterDelay(DateTime.Seconds(2), function()	 -- fuse flags
		for k,v in ipairs(CTFlags) do
			GetNearFlag(v)
		end
		return CTFlags
	end)
end
CTFFLagtypes = { "ctflag" }
CTbs = { "miss", "camera" }
function GetNearFlag (flag)
	local flagactors = Map.ActorsInCircle(flag.CenterPosition , WDist.FromCells(14), function(bld)	
			return  bld.Type == CTbs[1] or bld.Type == CTbs[2]
	end)
	Trigger.OnEnteredProximityTrigger(flag.CenterPosition, WDist.FromCells(3), function(a, id)
		local mine = flag.Owner
		local yours = a.Owner
		if mine ~= yours and  mine.IsAlliedWith(yours) ~= true and yours ~= Neutral and yours ~= Player.GetPlayer("Creeps") and Actor.CruiseAltitude(a.Type) == 0 and a.Type ~= "1tnk.husk" and a.Type ~= "2tnk.husk" and a.Type ~= "3tnk.husk" and a.Type ~= "4tnk.husk" and a.Type ~= "harv.fullhusk" and a.Type ~= "harv.emptyhusk" and a.Type ~= "mcv.husk" and a.Type ~= "mgg.husk" and a.Type ~= "camera" and a.Type ~= "camera.paradrop" and a.Type ~= "camera.spyplane" and a.Type ~= "lst"  then		
			flag.Owner = yours
			if flagactors ~= nil  then
				for i,v in ipairs(flagactors) do
					if v ~= nil then
						v.Owner = yours  -- Desync solved?
					end
				end 
			end
		end
	end)	
end
ShuffleTracks = { 1, 2, 3 }
JumpTrack = { 1, 2 }
PlayNewTrack = function()
	Jump = Utils.Random(JumpTrack)
	Media.PlayMusic("track" .. TrackNumber .. "")
	Trigger.AfterDelay(DateTime.Seconds(37), function()
		TrackNumber = TrackNumber + Jump
		if TrackNumber > 16 then TrackNumber = Utils.Random(ShuffleTracks) end
		Trigger.AfterDelay(DateTime.Seconds(5), function()
			PlayNewTrack()
		end)
	end)
end

function WorldLoaded()
	SetupPlayers()
	Cratecontrol()
	Setteleporttriggers()
	Setmovetriggers()
	SetteleporttriggersInsideOut()
	Notifications()
	TrackNumber = Utils.Random(ShuffleTracks)
	PlayNewTrack()
	GetandsetFlags()
end
