-- Startup
function InitGame(levelTime, randomSeed, restart)
	game.Print("Lua Level Init...");
	game.Print("-map_restart ...");
		game.Print("--workaround-setup ...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_levelchange");
			ent:SetKeyValue("targetname", "map_restart");
			ent:SetKeyValue("target", "borg3");
			entity.CallSpawn(ent);
		game.Print("--trigger-setup ...");
		if restart == 1 then
			game.ClientPrint(-1, "Please don't use map_restart, use map or devmap instead.");
			game.Print("Please don't use map_restart, use map or devmap instead.");
			ent = entity.Find("map_restart")
			entity.Use(ent)
		end
	game.Print("-Updating and fixing Forcefields (except Foster-Game");
		game.Print("--Forcefield Room 1");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "misc_model_breakable");
			ent:SetKeyValue("target", "entry_field");
			ent:SetKeyValue("health", "1");  
			ent:SetKeyValue("spawnflags", "1"); 
			ent:SetKeyValue("splashDamage", "75");  
			ent:SetKeyValue("splashRadius", "75");
			ent:SetKeyValue("material", "1");  
			ent:SetKeyValue("model", "models/mapobjects/borg/disnode.md3"); 
			mover.SetPosition(ent, 245, 788, 462);     
			mover.SetAngles(ent, 0, 180, 0);
			entity.CallSpawn(ent); 
			ent = entity.FindBModel(44);
			ent:SetKeyValue("classname", "func_forcefield");      
			entity.CallSpawn(ent);  
		game.Print("--Forcefield Room 2");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "misc_model_breakable");
			ent:SetKeyValue("target", "chasmfield1");
			ent:SetKeyValue("health", "1");
			ent:SetKeyValue("spawnflags", "1");
			ent:SetKeyValue("splashDamage", "75");  
			ent:SetKeyValue("splashRadius", "75");
			ent:SetKeyValue("material", "1");    
			ent:SetKeyValue("model", "models/mapobjects/borg/circuit_2.md3"); 
			mover.SetPosition(ent, -388, -944, 440);      
			mover.SetAngles(ent, 0, 0, 0);
			entity.CallSpawn(ent); 
			ent = entity.FindBModel(38);
			ent:SetKeyValue("classname", "func_forcefield");      
			entity.CallSpawn(ent); 
		game.Print("--Forcefield Room 4");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "misc_model_breakable");
			ent:SetKeyValue("target", "t283");
			ent:SetKeyValue("health", "1");  
			ent:SetKeyValue("spawnflags", "1"); 
			ent:SetKeyValue("splashDamage", "75");  
			ent:SetKeyValue("splashRadius", "75");
			ent:SetKeyValue("material", "1");  
			ent:SetKeyValue("model", "models/mapobjects/borg/disnode.md3"); 
			mover.SetPosition(ent, 1096, -441, 224);     
			mover.SetAngles(ent, 0, 45, 0);
			entity.CallSpawn(ent); 
			ent = entity.FindBModel(5);
			ent:SetKeyValue("classname", "func_forcefield");      
			entity.CallSpawn(ent);       
		game.Print("--Forcefield Hallway");  
			ent = entity.FindBModel(33);     
			entity.Use(ent);  
		game.Print("--Forcefield Room 5");
			ent = entity.FindBModel(112);
			ent:SetKeyValue("classname", "func_usable");  
			ent:SetKeyValue("spawnflags", "8");  
			ent:SetKeyValue("wait", "1");  
			ent:SetKeyValue("target", "endfield");
			ent:SetKeyValue("luaUse", "sound112");  
			mover.SetPosition(ent, 616, 1947.5, 256); 
			entity.CallSpawn(ent); 
			ent = entity.FindBModel(32);
			ent:SetKeyValue("classname", "func_forcefield");      
			entity.CallSpawn(ent);  
	game.Print("-Some Decorative Work...");  
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "misc_model_breakable");
		ent:SetKeyValue("spawnflags", "17");
		ent:SetKeyValue("model", "models/mapobjects/borg/plugin2.md3"); 
		mover.SetPosition(ent, 1077, -221, 235);     
		mover.SetAngles(ent, 0, 270, 0);
		entity.CallSpawn(ent);  
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "misc_model_breakable");
		ent:SetKeyValue("spawnflags", "17");
		ent:SetKeyValue("model", "models/mapobjects/borg/plugin.md3"); 
		mover.SetPosition(ent, 827, -685, 239);     
		mover.SetAngles(ent, 0, 180, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "misc_model_breakable");
		ent:SetKeyValue("spawnflags", "17");
		ent:SetKeyValue("model", "models/mapobjects/borg/plugin.md3"); 
		mover.SetPosition(ent, 991, 1060, 239);     
		mover.SetAngles(ent, 0, 180, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "misc_model_breakable");
		ent:SetKeyValue("spawnflags", "17");
		ent:SetKeyValue("model", "models/mapobjects/borg/plugin.md3"); 
		mover.SetPosition(ent, 1350, 1656, 253);     
		mover.SetAngles(ent, 0, 180, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "misc_model_breakable");
		ent:SetKeyValue("spawnflags", "17");
		ent:SetKeyValue("model", "models/mapobjects/borg/plugin.md3"); 
		mover.SetPosition(ent, 607, 1762, 253);     
		mover.SetAngles(ent, 0, 90, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "misc_model_breakable");
		ent:SetKeyValue("spawnflags", "17");
		ent:SetKeyValue("model", "models/mapobjects/borg/plugin.md3"); 
		mover.SetPosition(ent, 929, 1706, 253);     
		mover.SetAngles(ent, 0, 90, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "misc_model_breakable");
		ent:SetKeyValue("spawnflags", "17");
		ent:SetKeyValue("model", "models/mapobjects/borg/plugin2.md3"); 
		mover.SetPosition(ent, 930, 1882, 253);     
		mover.SetAngles(ent, 0, 270, 0);
		entity.CallSpawn(ent);    
	game.Print("-Transfer...");
		ent = entity.Spawn();
		ent.SetupTrigger(ent, 120, 16, 128);
		ent:SetKeyValue("classname", "trigger_multiple");
		ent:SetKeyValue("target", "transfercount");
		ent:SetKeyValue("wait", 1);
		entity.CallSpawn(ent);
		mover.SetPosition(ent, 404, 1952, 256);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "target_counter");
		ent:SetKeyValue("targetname", "transfercount");
		ent:SetKeyValue("target", "transfer");
		ent:SetKeyValue("count", "1");
		mover.SetPosition(ent, 0, 0, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "target_levelchange");
		ent:SetKeyValue("targetname", "transfer");
		ent:SetKeyValue("target", "borg4");
		ent:SetKeyValue("wait", "-1");
		mover.SetPosition(ent, 0, 0, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "target_relay");
		ent:SetKeyValue("targetname", "transfer");
		ent:SetKeyValue("target", "endfield");
		mover.SetPosition(ent, 0, 0, 0);
		entity.CallSpawn(ent);
	game.Print("-Setting up spawnpoints...");
		entity.RemoveSpawns();
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "info_player_start");
		mover.SetPosition(ent, 174, 1186, 412);  
		mover.SetAngles(ent, 0, 270, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "info_player_start");
		mover.SetPosition(ent, 132, 1164, 408); 
		mover.SetAngles(ent, 0, 270, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "info_player_start");
		mover.SetPosition(ent, 88, 1192, 408); 
		mover.SetAngles(ent, 0, 180, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "info_player_start");
		mover.SetPosition(ent, 96, 1264, 412);  
		mover.SetAngles(ent, 0, 180, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "info_player_start");
		mover.SetPosition(ent, 184, 1248, 408);
		mover.SetAngles(ent, 0, 225, 0);
		entity.CallSpawn(ent);
	game.Print("-Breakable-Mod...");
		game.Print("--func_breakable...");
			ent = entity.FindBModel(93);
			ent:SetKeyValue("material", "2");
			ent:SetKeyValue("splashDamage", "75");
			ent:SetKeyValue("splashRadius", "75");
			entity.CallSpawn(ent);
			ent = entity.FindBModel(92);
			ent:SetKeyValue("team", "2")
			entity.CallSpawn(ent)
			ent = entity.FindBModel(24);
			ent:SetKeyValue("material", "2");
			ent:SetKeyValue("splashDamage", "75");
			ent:SetKeyValue("splashRadius", "75");
			entity.CallSpawn(ent);
			ent = entity.FindBModel(23);
			ent:SetKeyValue("team", "2")
			entity.CallSpawn(ent)
			ent = entity.FindBModel(91);
			ent:SetKeyValue("material", "2");
			ent:SetKeyValue("splashDamage", "75");
			ent:SetKeyValue("splashRadius", "75");
			entity.CallSpawn(ent);
			ent = entity.FindBModel(90);
			ent:SetKeyValue("team", "2")
			entity.CallSpawn(ent)
			ent = entity.FindBModel(6);
			ent:SetKeyValue("material", "2");
			ent:SetKeyValue("splashDamage", "75");
			ent:SetKeyValue("splashRadius", "75");
			entity.CallSpawn(ent);
			ent = entity.FindBModel(7);
			ent:SetKeyValue("team", "2")
			entity.CallSpawn(ent)
			ent	= entity.FindBModel(113);
			ent:SetKeyValue("material", "2");
			ent:SetKeyValue("splashDamage", "75");
			ent:SetKeyValue("splashRadius", "75");
			entity.CallSpawn(ent);
			ent = entity.FindBModel(114);
			ent:SetKeyValue("team", "2")
			entity.CallSpawn(ent)
			ent = entity.FindBModel(117);
			ent:SetKeyValue("material", "2");
			ent:SetKeyValue("splashDamage", "75");
			ent:SetKeyValue("splashRadius", "75");
			entity.CallSpawn(ent);
			ent = entity.FindBModel(118);
			ent:SetKeyValue("team", "2")
			entity.CallSpawn(ent)
			ent = entity.FindBModel(119);
			ent:SetKeyValue("material", "2");
			ent:SetKeyValue("splashDamage", "75");
			ent:SetKeyValue("splashRadius", "75");
			entity.CallSpawn(ent);
			ent = entity.FindBModel(120);
			ent:SetKeyValue("team", "2")
			entity.CallSpawn(ent)
			ent = entity.FindBModel(115);
			ent:SetKeyValue("material", "2");
			ent:SetKeyValue("splashDamage", "75");
			ent:SetKeyValue("splashRadius", "75");
			entity.CallSpawn(ent);
			ent = entity.FindBModel(116);
			ent:SetKeyValue("team", "2")
			entity.CallSpawn(ent)
			ent = entity.FindBModel(84);
			ent:SetKeyValue("material", "2");
			ent:SetKeyValue("splashDamage", "75");
			ent:SetKeyValue("splashRadius", "75");
			entity.CallSpawn(ent);
			ent = entity.FindBModel(83);
			ent:SetKeyValue("team", "2")
			entity.CallSpawn(ent)
			ent = entity.FindBModel(86);
			ent:SetKeyValue("material", "2");
			ent:SetKeyValue("splashDamage", "75");
			ent:SetKeyValue("splashRadius", "75");
			entity.CallSpawn(ent);
			ent = entity.FindBModel(85);
			ent:SetKeyValue("team", "2")
			entity.CallSpawn(ent)
			ent = entity.FindBModel(21);
			ent:SetKeyValue("material", "1");
			entity.CallSpawn(ent);
			ent = entity.FindBModel(3);
			ent:SetKeyValue("material", "1");
			entity.CallSpawn(ent);
			ent = entity.FindBModel(88);
			ent:SetKeyValue("material", "2");
			ent:SetKeyValue("splashDamage", "75");
			ent:SetKeyValue("splashRadius", "75");
			entity.CallSpawn(ent);
			ent = entity.FindBModel(87);
			ent:SetKeyValue("team", "2")
			entity.CallSpawn(ent)
		game.Print("--misc_model_breakable...");
			game.Print("---checking for local or dedicated..."); 
				if not entity.FindNumber(361) == nil then
				ent = entity.FindNumber(361);
				test = ent.GetClassname(ent);
				if test == "misc_model_breakable" then
			game.Print("----dedicated...");
				ent = entity.FindNumber(224);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(225);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(226);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(228);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(229);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(230);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(231);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(232);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(233);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(234);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(235);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(236);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(237);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(238);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(239);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(240);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(241);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(242);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(243);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(244);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(246);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(247);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(248);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(250);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(251);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent); 
				ent = entity.FindNumber(286);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(287);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(322);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(361);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				else
			game.Print("----local...");
				ent = entity.FindNumber(222);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(223);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(224);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(226);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(227);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(228);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(229);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(230);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(231);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(232);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(233);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(234);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(235);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(236);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(237);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(238);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(239);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(240);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(241);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(242);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(244);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(245);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(246);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(248);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(249);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(284);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(285);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(320);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(359);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				end
				else
			game.Print("----local...");
				ent = entity.FindNumber(222);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(223);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(224);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(226);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(227);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(228);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(229);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(230);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(231);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(232);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(233);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(234);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(235);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(236);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(237);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(238);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(239);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(240);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(241);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(242);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(244);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(245);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(246);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(248);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(249);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(284);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(285);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(320);
				ent:SetKeyValue("material", "1");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				ent = entity.FindNumber(359);
				ent:SetKeyValue("material", "2");
				ent:SetKeyValue("splashDamage", "75");
				ent:SetKeyValue("splashRadius", "75");
				entity.CallSpawn(ent);
				end
	game.Print("-Rescue The Foster/Wesker...");
		game.Print("--Element fixes...");
			game.Print("---Fixing Forcefields..."); 
				ent = entity.FindBModel(48);
				ent:SetKeyValue("classname", "func_forcefield");      
				entity.CallSpawn(ent)
				ent = entity.FindBModel(102);
				ent:SetKeyValue("classname", "func_forcefield");      
				entity.CallSpawn(ent)
				ent = entity.FindBModel(103);
				ent:SetKeyValue("classname", "func_forcefield");      
				entity.CallSpawn(ent)  
			game.Print("---Controler Setup...");  
				ent = entity.FindBModel(122); 
				ent:SetKeyValue("classname", "func_usable"); 
				ent:SetKeyValue("spawnflags", "8");       
				ent:SetKeyValue("wait", "1");       
				ent:SetKeyValue("target", "foster_field"); 
				ent:SetKeyValue("luaUse", "sound122");    
				entity.CallSpawn(ent)  
				ent = entity.FindBModel(4); 
				ent:SetKeyValue("classname", "func_usable"); 
				ent:SetKeyValue("spawnflags", "8");       
				ent:SetKeyValue("wait", "1");       
				ent:SetKeyValue("target", "bed2");
				ent:SetKeyValue("luaUse", "sound4");      
				entity.CallSpawn(ent) 
				mover.SetPosition(ent, 721, -1600, 341); 
				ent = entity.FindBModel(121); 
				ent:SetKeyValue("classname", "func_usable"); 
				ent:SetKeyValue("spawnflags", "8");       
				ent:SetKeyValue("wait", "1");       
				ent:SetKeyValue("target", "t310"); 
				ent:SetKeyValue("luaUse", "sound121");     
				entity.CallSpawn(ent)  
			game.Print("---Lift Setup...");  
				ent = entity.FindBModel(94);         
				ent:SetKeyValue("wait", "-1");
				ent:SetKeyValue("angle", "-2");  
				ent:SetKeyValue("count", "96");  
				ent:SetKeyValue("spawnflags", "1");    
				entity.CallSpawn(ent) 
				ent = entity.FindBModel(95); 
				ent:SetKeyValue("wait", "-1");
				ent:SetKeyValue("angle", "-2");  
				ent:SetKeyValue("count", "96");  
				ent:SetKeyValue("spawnflags", "1");    
				entity.CallSpawn(ent) 
				ent = entity.FindBModel(97);        
				ent:SetKeyValue("wait", "-1");
				ent:SetKeyValue("angle", "-2");  
				ent:SetKeyValue("count", "96");     
				entity.CallSpawn(ent) 
				ent = entity.FindBModel(98);       
				ent:SetKeyValue("wait", "-1");
				ent:SetKeyValue("angle", "-2");  
				ent:SetKeyValue("count", "96");  
				ent:SetKeyValue("spawnflags", "1");    
				entity.CallSpawn(ent) 
			game.Print("---Lift control Positioning..."); 
				game.Print("----Bed 2...");  
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_boolean");
					ent:SetKeyValue("swapname", "bed2");
					ent:SetKeyValue("truetarget", "bed2up");
					ent:SetKeyValue("falsetarget", "bed2down");
					ent:SetKeyValue("spawnflags", "2");   
					entity.CallSpawn(ent) 
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_relay");
					ent:SetKeyValue("targetname", "bed2up");
					ent:SetKeyValue("luaUse", "bed2upscript");
					entity.CallSpawn(ent) 
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_relay");
					ent:SetKeyValue("targetname", "bed2down");
					ent:SetKeyValue("luaUse", "bed2downscript");
					entity.CallSpawn(ent) 
				game.Print("----Bed 3...");  
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_boolean");
					ent:SetKeyValue("swapname", "t310");
					ent:SetKeyValue("truetarget", "bed3up");
					ent:SetKeyValue("falsetarget", "bed3down");
					ent:SetKeyValue("spawnflags", "3");   
					entity.CallSpawn(ent) 
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_relay");
					ent:SetKeyValue("targetname", "bed3up");
					ent:SetKeyValue("luaUse", "bed3upscript");
					entity.CallSpawn(ent) 
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_relay");
					ent:SetKeyValue("targetname", "bed3down");
					ent:SetKeyValue("luaUse", "bed3downscript");
					entity.CallSpawn(ent);   
		game.Print("--Rescue-Script-setup...");
			game.Print("---Foster vs Wesker switch...");
				game.Print("----Boolean...");
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_boolean");
					ent:SetKeyValue("targetname", "t327");
					ent:SetKeyValue("swapname", "weskeroff");
					ent:SetKeyValue("falsetarget", "weskersetup");
					ent:SetKeyValue("spawnflags", 4);
					entity.CallSpawn(ent);
				game.Print("----Message: anyone Else...");
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_print");
					ent:SetKeyValue("targetname", "weskersetup");
					ent:SetKeyValue("message", "Wesker: I don't need anyone else.");
					entity.CallSpawn(ent);
			game.Print("---Point of no return...");
				game.Print("----relay with selfflag...");    
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_relay");
					ent:SetKeyValue("targetname", "weskeroff-relay");
					ent:SetKeyValue("target", "weskeroff");
					ent:SetKeyValue("spawnflags", 8);
					entity.CallSpawn(ent);      
				game.Print("----trigger to call the script and end selection...");
					ent = entity.Spawn();
					ent.SetupTrigger(ent, 16, 128, 96);
					ent:SetKeyValue("classname", "trigger_multiple");
					ent:SetKeyValue("target", "prestartcount");
					ent:SetKeyValue("wait", 1);
					entity.CallSpawn(ent);
					mover.SetPosition(ent, 336, -1424, 336);
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_counter");
					ent:SetKeyValue("targetname", "prestartcount");
					ent:SetKeyValue("target", "weskeroff-relay");
					ent:SetKeyValue("count", "1");
					mover.SetPosition(ent, 0, 0, 0);
					entity.CallSpawn(ent); 
				game.Print("----Selection-Boolean and relays for script-calling...");
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_boolean");
					ent:SetKeyValue("targetname", "weskeroff-relay");
					ent:SetKeyValue("swapname", "weskersetup");
					ent:SetKeyValue("falsetarget", "gofoster");
					ent:SetKeyValue("truetarget", "print_possible");
					ent:SetKeyValue("spawnflags", 4);
					entity.CallSpawn(ent);
				game.Print("----Message: Possible?...");
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_print");
					ent:SetKeyValue("targetname", "print_possible");
					ent:SetKeyValue("message", "Wesker: How is this possible?");
					entity.CallSpawn(ent);
			game.Print("---Script caller...");
				game.Print("----Foster...");
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_relay");
					ent:SetKeyValue("targetname", "gofoster");
					ent:SetKeyValue("luaUse", "fosterscript");
					entity.CallSpawn(ent);
				game.Print("----Wesker...");
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_relay");
					ent:SetKeyValue("targetname", "weskersetup");
					ent:SetKeyValue("luaUse", "weskerscript");
					ent:SetKeyValue("spawnflags", 8);
					entity.CallSpawn(ent);
			game.Print("---First Forcefield...");
				game.Print("----Trigger Setup...");
					ent = entity.Spawn();
					ent.SetupTrigger(ent, 16, 128, 96);
					ent:SetKeyValue("classname", "trigger_multiple");
					ent:SetKeyValue("target", "firstfieldcount");
					ent:SetKeyValue("wait", 1);
					entity.CallSpawn(ent);
					mover.SetPosition(ent, 1000, -1424, 336);
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_counter");
					ent:SetKeyValue("targetname", "firstfieldcount");
					ent:SetKeyValue("target", "openfielddelay");
					ent:SetKeyValue("count", "1");
					mover.SetPosition(ent, 0, 0, 0);
					entity.CallSpawn(ent);
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_delay");
					ent:SetKeyValue("targetname", "openfielddelay");
					ent:SetKeyValue("target", "openfield");
					ent:SetKeyValue("wait", "10");
					mover.SetPosition(ent, 0, 0, 0);
					entity.CallSpawn(ent);
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_delay");
					ent:SetKeyValue("targetname", "openfielddelay");
					ent:SetKeyValue("target", "fosterlbcount");
					ent:SetKeyValue("wait", "40");
					mover.SetPosition(ent, 0, 0, 0);
					entity.CallSpawn(ent);
					ent = entity.Spawn();
					ent:SetKeyValue("classname", "target_relay");
					ent:SetKeyValue("targetname", "openfield");
					ent:SetKeyValue("target", "firstbed");
					mover.SetPosition(ent, 0, 0, 0);
					entity.CallSpawn(ent);
			game.Print("---Leave-behind Setup...");
				ent = entity.Spawn();
				ent.SetupTrigger(ent, 16, 128, 96);
				ent:SetKeyValue("classname", "trigger_multiple");
				ent:SetKeyValue("target", "fosterlbcount");
				ent:SetKeyValue("wait", 1);
				entity.CallSpawn(ent);
				mover.SetPosition(ent, 1368, -1424, 336);
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_counter");
				ent:SetKeyValue("targetname", "fosterlbcount");
				ent:SetKeyValue("target", "fosterbedcheck");
				ent:SetKeyValue("count", "1");
				mover.SetPosition(ent, 0, 0, 0);
				entity.CallSpawn(ent);
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_boolean");
				ent:SetKeyValue("targetname", "fosterbedcheck");
				ent:SetKeyValue("swapname", "fostersave");
				ent:SetKeyValue("falsetarget", "fosterbed");
				ent:SetKeyValue("spawnflags", "4");
				mover.SetPosition(ent, 0, 0, 0);
				entity.CallSpawn(ent); 
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_relay");
				ent:SetKeyValue("targetname", "fosterbed");
				ent:SetKeyValue("target", "foster");
				mover.SetPosition(ent, 0, 0, 0);
				entity.CallSpawn(ent); 
			game.Print("---Foster-Save Setup...");
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_counter");
				ent:SetKeyValue("targetname", "foster_field");
				ent:SetKeyValue("target", "fostersavecheck");
				ent:SetKeyValue("count", "1");
				mover.SetPosition(ent, 0, 0, 0);
				entity.CallSpawn(ent);
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_boolean");
				ent:SetKeyValue("targetname", "fostersavecheck");
				ent:SetKeyValue("swapname", "fosterbed");
				ent:SetKeyValue("falsetarget", "fostersave");
				ent:SetKeyValue("spawnflags", "4");
				mover.SetPosition(ent, 0, 0, 0);
				entity.CallSpawn(ent);
			game.Print("----Welcome Setup...");
				ent = entity.Spawn();
				ent.SetupTrigger(ent, 16, 128, 96);
				ent:SetKeyValue("classname", "trigger_multiple");
				ent:SetKeyValue("target", "welcomecount");
				ent:SetKeyValue("wait", 1);
				entity.CallSpawn(ent);
				mover.SetPosition(ent, 620, -1424, 336);
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_counter");
				ent:SetKeyValue("targetname", "welcomecount");
				ent:SetKeyValue("target", "print_welcome");
				ent:SetKeyValue("count", "1");
				mover.SetPosition(ent, 0, 0, 0);
				entity.CallSpawn(ent);
game.Print("...Done");
end     

-- Functions 

function bed2upscript(ent, other, activator) 
	ent = entity.FindBModel(4); 
	mover.SetPosition(ent, 721, -1600, 461); 
	entity.CallSpawn(ent);   
	ent = entity.FindBModel(95); 
	entity.Use(ent);     
end

function bed2downscript(ent, other, activator) 
	ent = entity.FindBModel(4); 
	mover.SetPosition(ent, 721, -1600, 341); 
	entity.CallSpawn(ent);
	ent = entity.FindBModel(95); 
	entity.Use(ent);     
end

function bed3upscript(ent, other, activator) 
	ent = entity.FindBModel(121);
	mover.SetPosition(ent, 1161, -1248, 461);
	entity.CallSpawn(ent);   
end

function bed3downscript(ent, other, activator) 
	ent = entity.FindBModel(121);
	mover.SetPosition(ent, 1161, -1248, 341); 
	entity.CallSpawn(ent);   
end
	

function fosterscript(ent, other, activator)
	game.Print("-Start spawnage...");
		game.Print("--T=0-Stuff...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "openfield");
			ent:SetKeyValue("message", "Begin!");
			entity.CallSpawn(ent);
		game.Print("--T-1-Stuff...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_delay");
			ent:SetKeyValue("targetname", "openfielddelay");
			ent:SetKeyValue("target", "print_-1");
			ent:SetKeyValue("wait", "9");
			entity.CallSpawn(ent);
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "print_-1");
			ent:SetKeyValue("message", "Rescue the Foster starts in 1");
			entity.CallSpawn(ent);
		game.Print("--T-2-Stuff...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_delay");
			ent:SetKeyValue("targetname", "openfielddelay");
			ent:SetKeyValue("target", "print_-2");
			ent:SetKeyValue("wait", "8");
			entity.CallSpawn(ent);
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "print_-2");
			ent:SetKeyValue("message", "Rescue the Foster starts in 2");
			entity.CallSpawn(ent);
		game.Print("--T-3-Stuff...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_delay");
			ent:SetKeyValue("targetname", "openfielddelay");
			ent:SetKeyValue("target", "print_-3");
			ent:SetKeyValue("wait", "7");
			entity.CallSpawn(ent);
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "print_-3");
			ent:SetKeyValue("message", "Rescue the Foster starts in 3");
			entity.CallSpawn(ent);
		game.Print("--T-4-Stuff...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_delay");
			ent:SetKeyValue("targetname", "openfielddelay");
			ent:SetKeyValue("target", "print_-4");
			ent:SetKeyValue("wait", "6");
			entity.CallSpawn(ent);
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "print_-4");
			ent:SetKeyValue("message", "Rescue the Foster starts in 4");
			entity.CallSpawn(ent);
		game.Print("--T-5-Stuff...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_delay");
			ent:SetKeyValue("targetname", "openfielddelay");
			ent:SetKeyValue("target", "print_-5");
			ent:SetKeyValue("wait", "5");
			entity.CallSpawn(ent);
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "print_-5");
			ent:SetKeyValue("message", "Rescue the Foster starts in 5");
			entity.CallSpawn(ent);
		game.Print("--T-6-Stuff...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_delay");
			ent:SetKeyValue("targetname", "openfielddelay");
			ent:SetKeyValue("target", "print_-6");
			ent:SetKeyValue("wait", "4");
			entity.CallSpawn(ent);
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "print_-6");
			ent:SetKeyValue("message", "Rescue the Foster starts in 6");
			entity.CallSpawn(ent);
		game.Print("--T-7-Stuff...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_delay");
			ent:SetKeyValue("targetname", "openfielddelay");
			ent:SetKeyValue("target", "print_-7");
			ent:SetKeyValue("wait", "3");
			entity.CallSpawn(ent);
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "print_-7");
			ent:SetKeyValue("message", "Rescue the Foster starts in 7");
			entity.CallSpawn(ent);
		game.Print("--T-8-Stuff...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_delay");
			ent:SetKeyValue("targetname", "openfielddelay");
			ent:SetKeyValue("target", "print_-8");
			ent:SetKeyValue("wait", "2");
			entity.CallSpawn(ent);
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "print_-8");
			ent:SetKeyValue("message", "Rescue the Foster starts in 8");
			entity.CallSpawn(ent);
		game.Print("--T-9-Stuff...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_delay");
			ent:SetKeyValue("targetname", "openfielddelay");
			ent:SetKeyValue("target", "print_-9");
			ent:SetKeyValue("wait", "1");
			entity.CallSpawn(ent);
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "print_-9");
			ent:SetKeyValue("message", "Rescue the Foster starts in 9");
			entity.CallSpawn(ent);
		game.Print("--T-10-Stuff...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "openfielddelay");
			ent:SetKeyValue("message", "Rescue the Foster starts in 10");
			entity.CallSpawn(ent);
		game.Print("--Saved...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "fostersave");
			ent:SetKeyValue("message", "Congratulations, You rescued the Foster!");
			entity.CallSpawn(ent);
		game.Print("--Failed...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "fosterbed");
			ent:SetKeyValue("message", "You did not rescue the Foster.");
			entity.CallSpawn(ent);
		game.Print("--welcome...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "print_welcome");
			ent:SetKeyValue("message", "Welcome to 'Rescue the Foster'!");
			entity.CallSpawn(ent);
end

function weskerscript(ent, other, activator)
	game.Print("-Start spawnage...");
		game.Print("--Model-Mod...");
			ent = entity.Find("foster");
			ent:SetKeyValue("model", "models/mapobjects/borg/borg_munro.md3");
			entity.CallSpawn(ent);
		game.Print("--T-10-Stuff...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "openfielddelay");
			ent:SetKeyValue("message", "Wesker: Fourty Seconds... Forty Seconds is all I can spare to wait for you.");
			entity.CallSpawn(ent);
		game.Print("--Saved...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "fostersave");
			ent:SetKeyValue("message", "Wesker: I suppose I should thank you.");
			entity.CallSpawn(ent);
		game.Print("--Failed...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "fosterbed");
			ent:SetKeyValue("message", "Wesker: YOU FAILED ME!!!");
			entity.CallSpawn(ent);
		game.Print("--Welcome...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "print_welcome");
			ent:SetKeyValue("message", "Wesker: It is in your best intrest to assist me!");
			entity.CallSpawn(ent);
		game.Print("--First Aid...");
			ent = entity.Spawn();
			ent.SetupTrigger(ent, 16, 128, 96);
			ent:SetKeyValue("classname", "trigger_multiple");
			ent:SetKeyValue("target", "aidcount");
			ent:SetKeyValue("wait", 1);
			entity.CallSpawn(ent);
			mover.SetPosition(ent, 1032, -1248, 336);
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_counter");
			ent:SetKeyValue("targetname", "aidcount");
			ent:SetKeyValue("target", "aidbool");
			ent:SetKeyValue("count", "1");
			mover.SetPosition(ent, 0, 0, 0);
			entity.CallSpawn(ent);
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_boolean");
			ent:SetKeyValue("targetname", "aidbool");
			ent:SetKeyValue("swapname", "fosterbed");
			ent:SetKeyValue("falsetarget", "print_aid");
			mover.SetPosition(ent, 0, 0, 0);
			entity.CallSpawn(ent);
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_print");
			ent:SetKeyValue("targetname", "print_aid");
			ent:SetKeyValue("message", "Wesker: You will give me a can of First-Aid-Spray!");
			entity.CallSpawn(ent);
		game.Print("--post rescue...");
			game.Print("---Modelboost-call...");
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_relay");
				ent:SetKeyValue("targetname", "fostersave");
				ent:SetKeyValue("luaUse", "boomwesker");
				entity.CallSpawn(ent);
			game.Print("---Prepare...");
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_delay");
				ent:SetKeyValue("targetname", "fostersave");
				ent:SetKeyValue("target", "print_prepare");
				ent:SetKeyValue("wait", "5");
				entity.CallSpawn(ent);
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_print");
				ent:SetKeyValue("targetname", "print_prepare");
				ent:SetKeyValue("message", "Wesker: Now Prepare yourselfs...");
				entity.CallSpawn(ent);
			game.Print("---Complete...");
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_delay");
				ent:SetKeyValue("targetname", "fostersave");
				ent:SetKeyValue("target", "print_complete");
				ent:SetKeyValue("wait", "8");
				entity.CallSpawn(ent);
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_print");
				ent:SetKeyValue("targetname", "print_complete");
				ent:SetKeyValue("message", "Wesker: ... for COMPLETE, ");
				entity.CallSpawn(ent);
			game.Print("---Global...");
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_delay");
				ent:SetKeyValue("targetname", "fostersave");
				ent:SetKeyValue("target", "print_global");
				ent:SetKeyValue("wait", "10");
				entity.CallSpawn(ent);
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_print");
				ent:SetKeyValue("targetname", "print_global");
				ent:SetKeyValue("message", "Wesker: GLOBAL,");
				entity.CallSpawn(ent);
			game.Print("---saturation...");
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_delay");
				ent:SetKeyValue("targetname", "fostersave");
				ent:SetKeyValue("target", "print_saturation");
				ent:SetKeyValue("wait", "12");
				entity.CallSpawn(ent);
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_print");
				ent:SetKeyValue("targetname", "print_saturation");
				ent:SetKeyValue("message", "Wesker: SATURATION!!!");
				entity.CallSpawn(ent);
			game.Print("---BANG...");
				ent = entity.Spawn();
				ent:SetKeyValue("classname", "target_delay");
				ent:SetKeyValue("targetname", "fostersave");
				ent:SetKeyValue("target", "foster");
				ent:SetKeyValue("wait", "14");
				entity.CallSpawn(ent);
end

function boomwesker(ent, other, activator)
	ent = entity.Find("foster");
	ent:SetKeyValue("material", "0");
	ent:SetKeyValue("splashDamage", "99999");
	ent:SetKeyValue("splashRadius", "99999");
	entity.CallSpawn(ent);
end 

--Sounds

function sound4(ent, other, activator)
    sound.PlaySound(entity.FindBModel(4), "sound/movers/switches/borglcarswitch.mp3", 0);
end

function sound112(ent, other, activator)
    sound.PlaySound(entity.FindBModel(112), "sound/movers/switches/borglcarswitch.mp3", 0);
end

function sound121(ent, other, activator)
    sound.PlaySound(entity.FindBModel(121), "sound/movers/switches/borglcarswitch.mp3", 0);
end

function sound122(ent, other, activator)
    sound.PlaySound(entity.FindBModel(122), "sound/movers/switches/borglcarswitch.mp3", 0);
end