Hello. I’ve been working on a zombie survival gamemode, only problem is, I need to add supported maps instead of supporting one map, making them all spawn at 0, 0, 0.
I know the perfect system for this. However, I need help actually getting it to work with my zombie spawn function(READ: below is a combine spawn function used as an example)
If you know how I could get this to work but don’t know about the “maps” system then this is how it works:
You create a folder called “maps” in your gamemode files. Inside the maps folder, you create .lua files name like so “map_namehere.lua”. Inside the .lua files, you add functions to be run when the player is playing on that map. I need an expert on this system to help me out with getting my zombie(combine, for the example) spawn function to work. I know how to use vectors and add them, btw, but I’m really confused with getting the maps to work.
Example combine spawn code:
function SpawnCombineElite1( pos ) NPC = ents.Create( "npc_combine_s" ) NPC:SetKeyValue("NumGrenades", "0") NPC:SetKeyValue( "model", "models/Combine_Super_Soldier.mdl" ) NPC:SetPos( pos ) NPC:SetKeyValue( "spawnflags", 768 ) NPC:Spawn() NPC:Give( "ai_weapon_ar2" ) NPC:SetCurrentWeaponProficiency( WEAPON_PROFICIENCY_GOOD ) NPC:Fire("StartPatrolling","",0) end function CombineWave() timer.Simple(2,CombineWave) if CountEntity("npc_combine_s") < 30 then SpawnCombineElite1(Vector(0,0,0)) --I also am confused as to what to do with this, should I replace "Vector" and the numbers and parentheses around it with "pos"? end end function CountEntity(ent) local entities=0 for k, v in pairs(ents.GetAll()) do if v:GetClass() == tostring(ent) then entities=entities+1 end end return(entities) end