Team Skeleton Gamemode

Hello everybody I make a gamemode base for people new in lua that want to make a gamemode for their own server and they do not have the skills to make one.

I make this file based on the skeleton by garry. I noticed that there is a gamemode base by rambo, however it is different because is the gamemode more easy to customize that you can be experienced.

I feel free to use any new file in the gamemode with the property credits for the autor in the code. Then i just need some feedback from some issues thant i do not know how to solve. This is the Team Skeleton Gamemode that i make using the program notepad++ (http://sourceforge.net/projects/notepad-plus/).

- Examples of beta gamemodes based on Team Skeleton Gamemode


Team skeleton gamemode v1.2
http://www.facepunch.com/showpost.php?p=12196827&postcount=30
Team skeleton gamemode v1.3
http://forums.facepunchstudios.com/showpost.php?p=12870254&postcount=46
Zombie skeleton gamemode v1.4
http://www.facepunch.com/showpost.php?p=12110238&postcount=22
Monster skeleton gamemode v1.1
http://www.facepunch.com/showpost.php?p=12173709&postcount=23
Counter skeleton gamemode v1.2
http://www.facepunch.com/showpost.php?p=12216400&postcount=31
Roleplay skeleton gamemode v1.0
http://www.facepunch.com/showpost.php?p=12230529&postcount=32
Halo skeleton gamemode v1.0
http://www.facepunch.com/showpost.php?p=12438277&postcount=36
Ironman skeleton gamemode v1.1
http://www.facepunch.com/showpost.php?p=12556110&postcount=41
Hlsource skeleton gamemode v1.0
http://www.facepunch.com/showpost.php?p=12582795&postcount=42
Stargate skeleton gamemode v1.0
http://www.facepunch.com/showpost.php?p=12663845&postcount=45
Starwars Skeleton gamemode v1.0
http://www.facepunch.com/showpost.php?p=19450775&postcount=49
Lef4dead Skeleton gamemode v1.1
http://www.facepunch.com/showpost.php?p=19533867&postcount=50 
Medieval Skeleton gamemode v1.0
http://www.facepunch.com/showpost.php?p=20388961&postcount=51
Sin Skeleton gamemode v1.0
http://www.facepunch.com/showpost.php?p=20815387&postcount=52

- New updates in the svn repository



SVN URL : http://skeletongamemodes.googlecode.com/svn/trunk/

How to use SVN:
1: If you do not already have an SVN client, get one. I recommend TortoiseSVN. (http://tortoisesvn.net/downloads)
2: Create a folder in your gamemodes directory called "teamskeleton".
3: Right click on your newly created teamskeleton folder and hit "SVN Checkout".
4: Enter the SVN URL found above.
5: You're done, let it download everything.
6: Profit!


Much point to this? You didn’t make that shouldtakedamage hook use mp_friendlyfire

Is this in shared.lua?
[lua]
function GM:PlayerShouldTakeDamage( ply, attacker )
if attacker:IsPlayer() then
if ply:SetTeam() == attacker:SetTeam() and attacker != ply then
return false
else
return true
end
else
return true
end
end
hook.Add( “PlayerShouldTakeDamage”, “playershouldtakedamage”, playershouldtakedamage)
[/lua]

or this is shared.lua?

[lua]
function GAMEMODE:PlayerShouldTakeDamage( victim, pl )
if( pl:Team() == victim:Team() and GetConVarNumber( “mp_friendlyfire” ) == 0 ) then // check the teams are equal and that friendly fire is off.
return false // do not damage the player
end

return true // damage the player
end
hook.Add( “PlayerShouldTakeDamage”, “playershouldtakedamage”, playershouldtakedamage)
[/lua]

Or this in init.lua?
[lua]
function GM:PlayerShouldTakeDamage(victim,attacker)
if attacker:IsValid() and attacker:IsPlayer() and (victim:Team() == attacker:Team() and server_settings.Bool( “mp_friendlyfire” ) == false) then
return false
else
return true
end
end
[/lua]

Or this in shared.lua?

[lua]
function GM:PlayerShouldTakeDamage( ply, attacker )
if attacker:IsPlayer() then
if ply:Team() == attacker:Team() and attacker != ply then
return false
else
return true
end
else
return true
end
end
[/lua]

Re:

Oh, I forget to mention that players are divided in TEAM BLUE AND TEAM RED

[lua]function GM:PlayerInitialSpawn(ply)
if team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_BLUE)
else
ply:SetTeam(TEAM_RED)
end
self.BaseClass:PlayerInitialSpawn(ply)
end[/lua]

You know Garry added team handling into the base gamemode a couple of updates ago? Also I don’t have s clue what you’re on about with the first snippet, all you would need it to do is use that convar

You mean use settings about damage when you make a server in garrysmod or you mean use the convar into the code?.. Can you specify exactly what i need to put in which part of the code because there are only three files to look into. Or Anybody know how to do the friendly fire thing off by default?

I just look here and i found this

Edit:

Another thing I recently discovered that it change name of the gamemode, it will be in shared.lua.

[lua]
GM.Name = “Your gamemode”
GM.Author = “yourname”
GM.Email = “”
GM.Website = “”
[/lua]

Dude, if you don’t even know how to make a gamemode yourself how the -hell- are you going to make a base for others?

I am learning, troll. Is this code ok to make friendly fire off , it will be in init.lua ?

[lua]
function GM:PlayerShouldTakeDamage(victim,attacker)
if attacker:IsValid() and attacker:IsPlayer() and (victim:Team() == attacker:Team() and server_settings.Bool( “mp_friendlyfire” ) == false) then
return false
else
return true
end
end
[/lua]

so your uploading this to the gamemode contest?

I don’t think you should make a base for others to attempt to learn from or base another person project on until you have a complete understanding of the language and the engine. Or under the gamemode contest forum where my gamemode is still waiting to be judges 2 quarter years later.

Sure but I am in the compromise to make a team base. Can anybody help me to test that the code to make friendly fire off is ok and also how about to add differents class in each team? For example team read : shotgunner,sniper and team blue: medic,gunner…not derma just simple things

I have a team based code set up already. Coded it 2 days ago with team loadout and team colour. As for Friendly fire this is something I will work on tonight. I will upload my code and we can compare.

Do you add class in your gamemode and when you will released it?

Basically my gamemode has 2 teams. Red and Blue. There is a team based loadout (different guns for different teams)

In the init.lua file there is

[Lua]

function GM:PlayerDisconnected(ply)
ply:Spawn()
ply:Kill()
end
//We’re Moving In
function GM:PlayerInitialSpawn(ply)

//The basics of teamage. Learn this. All teams are defined in shared.lua.
if team.NumPlayers(TEAM_RED) > team.NumPlayers(TEAM_BLUE) then
ply:SetTeam(TEAM_BLUE)

	ply:ChatPrint( "You are on the Blue team! You have 3 lives!" )	

else

	ply:SetTeam(TEAM_RED)
	ply:ChatPrint( "You are on the Red Team! You have 3 lives!" )
	
	  
    

	
end

end
//Give the player there guns. Yes this gun is slow at reloading, but its the closest to a real laser gun.
//For anyone who cares, the gun is the pulse357 with the smg model.
function GM:PlayerLoadout( pl )
if pl:Team() == TEAM_BLUE then
pl:GiveAmmo( 120,“Pistol”, true )
pl:Give(“weapon_pistol”)
pl:SetHealth(100)

pl:SetColor(0, 0, 255, 255)
else
pl:GiveAmmo( 120,“Pisto l”, true )
pl:Give(“weapon_pistol”)
pl:SetHealth(100)

pl:SetColor(255, 0, 0, 255)

end

end

function GM:PlayerConnect( name, address, steamid )
for k, v in pairs(player.GetAll()) do
v:ChatPrint(name … " has joined the battle")
end
end
[/LUA]

and in shared.lua there is

[lua]
TEAM_BLUE = 1
TEAM_RED = 2

team.SetUp(TEAM_BLUE, “Blue Team”, Color(0,0,255,255))
team.SetUp(TEAM_RED, “Red Team”, Color(255,0,0,255))
[/lua]

This is the code of the gamemode “team skeleton gamemode v.1.1” :

  • Team red and Team blue for a team deathmatch gamemode, friendly fire is off (should be because nobody test it)
  • Playermodel system, team red (police playermodel) and team blue (barney playermodel)
  • Weapon system which include one weapon “empty_weapon” but you can add instead your own sweps
  • Map rotate each one hour, is easy to change what maps you want and the time
  • It use counter strike player spawn points, then it can be used with any map with counter strike waypoints
  • Default key to join in another team is SHIFT (IN_SPEED), to omit it deleted this “Text when you chose another team” in init.lua or change IN_F2 for example.
  • Added ply:SetHealth(100), ply:SetRunSpeed(700) and ply:SetWalkSpeed(400)to increase the speed in game
  • Sandbox information included in shared.lua also

cl_init.lua

[lua]
include(“shared.lua”)

function GM:SpawnMenuOpen()
return false
end

function GM:ContextMenuOpen()
return false
end
[/lua]

init.lua

[lua]
AddCSLuaFile(“cl_init.lua”)
AddCSLuaFile(“shared.lua”)
include(“shared.lua”)

function GM:PlayerInitialSpawn(ply)
if team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_BLUE)
else
ply:SetTeam(TEAM_RED)
end
self.BaseClass:PlayerInitialSpawn(ply)
end

function GM:PlayerLoadout(ply)
return
end

/---------------------------------------------------------
Weapons & playermodels system when you start the game by phpmysql
---------------------------------------------------------
/

function GM:PlayerSpawn(ply)
self.BaseClass:PlayerSpawn(ply)
if ply:Team() == TEAM_BLUE then
ply:SetModel(“models/player/barney.mdl”) – BLUE DEFAULT PLAYERMODEL eg: models/player/alien.mdl
ply:SetHealth(100) – -- DEFAULT HEALTH,RUNSPEED AND WALKSPEED BLUE TEAM
ply:SetRunSpeed(700)
ply:SetWalkSpeed(400)
ply:Give(“empty_weapon”) — WEAPONS FOR THE TEAM BLUE eg: ply:Give(“weapon_pistol”) ply:Give(“weapon_crowbar”)

else
ply:SetModel(“models/player/police.mdl”) – RED DEFAULT PLAYERMODEL eg: models/player/predator.mdl
ply:SetHealth(100) – -- DEFAULT HEALTH,RUNSPEED AND WALKSPEED RED TEAM
ply:SetRunSpeed(700)
ply:SetWalkSpeed(400)
ply:Give(“empty_weapon”) – WEAPONS FOR THE TEAM RED eg: ply:Give(“weapon_shotgun”) ply:Give(“weapon_crowbar”)
end
end

/---------------------------------------------------------
Text when you chose another team
---------------------------------------------------------
/

function GM:KeyPress(p, key)
if ( key == IN_SPEED ) then
if ( p:Team( )== TEAM_BLUE ) then
p:SetTeam( TEAM_RED )
p:Kill( )
p:PrintMessage(HUD_PRINTTALK,“you don’t want to be in the team red? Press ‘SHIFT’ to be one again!”); – eg: Aliens (blue)
p:SprintEnable ()
p:AddFrags(1)
else
p:SetTeam( TEAM_BLUE )
p:Kill( )
p:PrintMessage(HUD_PRINTTALK,“you don’t want to be in the team blue? Press ‘SHIFT’ to be one again!”); – eg: Predator(red)
p:SprintDisable ()
p:AddFrags(1)
end
end
self.BaseClass:KeyPress(p, key)
end

/---------------------------------------------------------
Text when you start the game
---------------------------------------------------------
/

function GM:PlayerInitialSpawn( pl )

pl:PrintMessage(HUD_PRINTCENTER,"Welcome to team BLUE Vs RED!");  -- eg: Welcome to the game Alien Vs.  Predator!

if (team.NumPlayers (TEAM_BLUE)) &lt; (team.NumPlayers (TEAM_RED)) then
pl:SetTeam( TEAM_BLUE )
pl:PrintMessage(HUD_PRINTTALK,"You're in the team blue. Press 'SHIFT' to be in the team red!"); -- eg: Aliens (blue)
pl:SprintDisable ()

else

pl:SetTeam( TEAM_RED )
pl:PrintMessage(HUD_PRINTTALK,"You're in the team red. Press 'SHIFT' to be in the team blue!"); -- eg: Predators (red)

end

end

/---------------------------------------------------------
Player Spawn is counter strike spawn points by blackops
---------------------------------------------------------
/

function GM:PlayerSelectSpawn(pl)
if self.redSpawns == nil then
self.redSpawns = table.Add(self.redSpawns,ents.FindByClass(“info_player_terrorist”))
end
if self.blueSpawns == nil then
self.blueSpawns = table.Add(self.blueSpawns,ents.FindByClass(“info_player_counterterrorist”))
end

local numSpwn = 0
local cSpawnList = nil
if pl:Team() == TEAM_BLUE then
	cSpawnList = self.blueSpawns
else
	cSpawnList = self.redSpawns
end

numSpwn = table.Count(cSpawnList)
if numSpwn == 0 then
	Msg("PlayerSelectSpawn error: no spawn available

")
return nil
end

local ChosenSpawnPoint = nil

for i=0,6 do
	ChosenSpawnPoint = cSpawnList[math.random(1,numSpwn)]
	if ChosenSpawnPoint && ChosenSpawnPoint:IsValid() && ChosenSpawnPoint:IsInWorld() && ChosenSpawnPoint != pl:GetVar( "LastSpawnpoint" ) then	
		pl:SetVar( "LastSpawnpoint", ChosenSpawnPoint )
		return ChosenSpawnPoint
	end
end
return ChosenSpawnPoint

end

/---------------------------------------------------------
Map Rotation system By gamerdude
---------------------------------------------------------
/

local mRotateTimeLeft=3600 --this is the round time in seconds (3600= 1 hr)
mapsList={“gm_construct”} – ie. mapsList={“gm_construct”,“gm_flatgrass”}
timeWarnings={}
timeWarnings[900]=“15 Minute Warning!” – this is the time warnings
timeWarnings[5]=“5”
timeWarnings[4]=“4”
timeWarnings[3]=“3”
timeWarnings[2]=“2”
timeWarnings[1]=“1”

if(SERVER) then
function nextMap()
cMapName=string.lower(game.GetMap())
cMapID=1
nMap=“gm_construct”

for k,v in pairs(mapsList) do
	if(string.lower(v)==cMapName) then
		cMapID=k
		if(k==table.Count(mapsList)) then
			nMap=mapsList[1]
		else
			nMap=mapsList[k+1]
		end
	end
end

return nMap

end
function MapRotate()
local nMap=nextMap()
game.ConsoleCommand("changelevel " … nMap … "
")
end

function setcountdown()
if(GetGlobalInt(“MapRotateCountDown”)<1) then
MapRotate()
return
end
local cTime=GetGlobalInt(“MapRotateCountDown”)-1
SetGlobalInt(“MapRotateCountDown”,cTime)
SetGlobalString(“MapRotateCountDownFormat”, SecondsToFormat(cTime))
if(timeWarnings[cTime]!=null) then
for k,v in pairs(player.GetAll()) do
v:PrintMessage(HUD_PRINTCENTER, timeWarnings[cTime])
end
end
end

function SecondsToFormat( secs )
local hours=math.floor(secs/60/60)
local mins=math.floor(secs/60)
local seconds=0
local timeleft=""
if not(hours==0) then
timeleft=hours … “:”
end
if not(mins==0) then
timeleft=timeleft … mins … “:”
else
timeleft=timeleft … “00:”
end
seconds=secs - (hours3600) - (mins60)
if (seconds<10) then
seconds=“0” … seconds
end
timeleft=timeleft … seconds

return timeleft

end

timeWarnings[7]=“Switching to " … nextMap() … " in…”
SetGlobalInt(“MapRotateCountDown”,mRotateTimeLeft)
SetGlobalString(“MapRotateCountDownFormat”, SecondsToFormat(mRotateTimeLeft))
timer.Create(“MapRotateCountDown”, 1, 0, setcountdown)
end
[/lua]

shared.lua

[lua]
TEAM_RED = 1
TEAM_BLUE = 2
team.SetUp(TEAM_RED, “Team Red Police”, Color(255, 0, 0, 255)) – TEAM RED, It appear in scores
team.SetUp(TEAM_BLUE, “Team Blue Barney”, Color(0, 0, 255, 255)) – TEAM BLUE, It appear in scores

/---------------------------------------------------------
Relevant information
---------------------------------------------------------
/

GM.Name = “Team Skeleton gamemode v1.1”
GM.Author = “phpmysql”
GM.Email = “”
GM.Website = “”

/---------------------------------------------------------
Map Rotation system By gamerdude, this is the HUD
---------------------------------------------------------
/

function DrawHud()
draw.WordBox( 10, ScrW() - 100, ScrH() - 150, "Timeleft: " … GetGlobalString(“MapRotateCountDownFormat”), “Default”,Color(0,0,0,100), Color(255,255,255,255))
end
hook.Add(“HUDPaint”, “HUD_TEST”, DrawHud)

/---------------------------------------------------------
Friendly Fire is off by default
---------------------------------------------------------
/

function GM:PlayerShouldTakeDamage( ply, attacker )
if attacker:IsPlayer() then
if ply:Team() == attacker:Team() and attacker != ply then
return false
else
return true
end
else
return true
end
end
[/lua]

Sounds cool. I might use it for a CS like gamemode.

Talking about spawn npcs in game. For example if you add this code in the end of the init.lua (in team skeleton gamemode), you can spawn your snpcs. However you need this file http://www.garrysmod.org/downloads/?a=view&id=54126 already installed in your addon folder. You must make your snpc that avoid collisions when you use this code.

[lua]
/---------------------------------------------------------
Spawn Zombies in game by flyslasher
---------------------------------------------------------
/

local function ZombieCreate( )

 local npc = ents.Create("npc_rex") -- eg : npc_zombie
 if GetGlobalInt("rexs") &lt; 30 then -- name of npcs
 npc:SetPos( Vector( 0, 0, 0 ) )
 npc:Spawn( )
 npc:SetName("rexs") -- name of npcs
 SetGlobalInt("rexs",GetGlobalInt("rexs")+1) -- name of npcs
 end

end

timer.Create(“ZombieSpawner”, 300, 0, ZombieCreate) – spawn each at 5 minutes, in seconds (5x60)
[/lua]

This is why i was thinking to make a gamemode with your addon or maybe a gta gamemode. Do you imagine a tank or helicopter following you in the city when you play this game for 15 minutes above?

More examples :

  1. A combine attack, must be in the end of the init.lua (in team skeleton gamemode). I disable collisions between npcs and another npcs and is disabled between the npcs and the players, You should define the value SetPos (position of the npc in the map) :

[lua]
/---------------------------------------------------------
Combine Attack by flyslasher & phpmysql
---------------------------------------------------------
/

local function MetropoliceCreate( )

local npc = ents.Create("npc_metropolice") -- eg : npc_Metropolice
if GetGlobalInt("metropolices") &lt; 30 then -- name of npcs
npc:Give( "ai_weapon_pistol" ) -- eg: ai_weapon_smg1
npc:SetPos( Vector( 0, 0, 0 ) )
npc:Spawn( )
npc:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE_DEBRIS); -- avoid collision between npcs
npc:SetName("metropolices") -- name of npcs
SetGlobalInt("metropolices",GetGlobalInt("metropolices")+1) -- name of npcs
end

end

timer.Create(“MetropoliceSpawner”, 60, 0, MetropoliceCreate) – spawn each at 1 minutes, in seconds

local function CombineCreate( )

local npc = ents.Create("npc_combine_s") -- eg : npc_zombie
if GetGlobalInt("combinesoldier") &lt; 30 then -- name of npcs
npc:SetModel("models/combine_soldier.mdl") -- eg :the model combine_soldier_prisonguard.mdl
npc:Give( "ai_weapon_shotgun" ) -- eg: ai_weapon_smg1
npc:SetPos( Vector( 100, 0, 0 ) )
npc:Spawn( )
npc:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE_DEBRIS); -- avoid collision between npcs
npc:SetName("combinesoldier") -- name of npcs
SetGlobalInt("combinesoldier",GetGlobalInt("combinesoldier")+1) -- name of npcs
end

end

timer.Create(“CombineSpawner”, 120, 0, CombineCreate) – spawn each at 2 minutes, in seconds

local function CombineSuperCreate( )

local npc = ents.Create("npc_combine_s") -- eg : npc_zombie
if GetGlobalInt("combinesuper") &lt; 30 then -- name of npcs
npc:SetModel("models/combine_super_soldier.mdl") -- eg :the model combine_soldier_prisonguard.mdl
npc:Give( "ai_weapon_ar2" ) -- eg: ai_weapon_smg1
npc:SetPos( Vector( 200, 0, 0 ) )
npc:Spawn( )
npc:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE_DEBRIS); -- avoid collision between npcs
npc:SetName("combinesuper") -- name of npcs
SetGlobalInt("combinesuper",GetGlobalInt("combinesuper")+1) -- name of npcs
end

end

timer.Create(“CombineSuperSpawner”, 180, 0, CombineSuperCreate) – spawn each at 3 minutes, in seconds
[/lua]

  1. A zombie attack, must be in the end of the init.lua (in team skeleton gamemode). I disable collisions between npcs and another npcs and is disabled between the npcs and the players, You should define the value SetPos (position of the npc in the map) :

[lua]/---------------------------------------------------------
Zombie Attack by flyslasher & phpmysql
---------------------------------------------------------
/

local function ZombieCreate( )

local npc = ents.Create("npc_zombie") -- eg : npc_zombie
if GetGlobalInt("zombies") &lt; 30 then -- name of npcs
npc:SetPos( Vector( 0, 0, 0 ) )
npc:Spawn( )
npc:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE_DEBRIS); -- avoid collision between npcs
npc:SetName("zombies") -- name of npcs
SetGlobalInt("zombies",GetGlobalInt("zombies")+1) -- name of npcs
end

end

timer.Create(“ZombieSpawner”, 60, 0, ZombieCreate) – spawn each at 1 minutes, in seconds

local function PoisonzombieCreate( )

local npc = ents.Create("npc_poisonzombie") -- eg : npc_zombie
if GetGlobalInt("poisonzombies") &lt; 30 then -- name of npcs
npc:SetPos( Vector( 100, 0, 0 ) )
npc:Spawn( )
npc:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE_DEBRIS); -- avoid collision between npcs
npc:SetName("poisonzombies") -- name of npcs
SetGlobalInt("poisonzombies",GetGlobalInt("poisonzombies")+1) -- name of npcs
end

end

timer.Create(“PoisonzombieSpawner”, 120, 0, PoisonzombieCreate) – spawn each at 2 minutes, in seconds

local function FastzombieCreate( )

local npc = ents.Create("npc_fastzombie") -- eg : npc_zombie
if GetGlobalInt("fastzombies") &lt; 30 then -- name of npcs
npc:SetPos( Vector( 200, 0, 0 ) )
npc:Spawn( )
npc:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE_DEBRIS); -- avoid collision between npcs
npc:SetName("fastzombies") -- name of npcs
SetGlobalInt("fastzombies",GetGlobalInt("fastzombies")+1) -- name of npcs
end

end

timer.Create(“FastzombieSpawner”, 180, 0, FastzombieCreate) – spawn each at 3 minutes, in seconds[/lua]

  1. An antlion attack, must be in the end of the init.lua (in team skeleton gamemode). I disable collisions between npcs and another npcs and is disabled between the npcs and the players, You should define the value SetPos (position of the npc in the map) :

[lua]
/---------------------------------------------------------
Antlion Attack by flyslasher & phpmysql
---------------------------------------------------------
/

local function AntlionCreate( )

local npc = ents.Create("npc_antlion") -- eg : npc_Antlion
if GetGlobalInt("antlions") &lt; 30 then -- name of npcs
npc:SetPos( Vector( 0, 0, 0 ) )
npc:Spawn( )
npc:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE_DEBRIS); -- avoid collision between npcs
npc:SetName("antlions") -- name of npcs
SetGlobalInt("antlions",GetGlobalInt("antlions")+1) -- name of npcs
end

end

timer.Create(“AntlionSpawner”, 60, 0, AntlionCreate) – spawn each at 1 minutes, in seconds

local function AntlionguardCreate( )

local npc = ents.Create("npc_antlionguard") -- eg : npc_zombie
if GetGlobalInt("antlionguards") &lt; 30 then -- name of npcs
npc:SetPos( Vector( 100, 0, 0 ) )
npc:Spawn( )
npc:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE_DEBRIS); -- avoid collision between npcs
npc:SetName("antlionguards") -- name of npcs
SetGlobalInt("antlionguards",GetGlobalInt("antlionguards")+1) -- name of npcs
end

end

timer.Create(“AntlionguardSpawner”, 300, 0, AntlionguardCreate) – spawn each at 5 minutes, in seconds
[/lua]

Edit:

Also i learned :

Also I found this for the player, sound interesting. http://www.garrysmod.org/downloads/?a=view&id=47890

So all in all, you haven’t actually written much of this base yourself?

And as someone above said, teams is already in the base game mode!

You are able to modify the base gamemode mode and add features like team read and team blue, or custom playermodels? I guess no, this is why team skeleton gamemode is easy to edit and useful, you can customize what you want.

I need help from a lua king to add clases in each team, it mean a improvement of code in the Team Skeleton gamemode v1.1 with five clases almost in each team (team blue and team red). I can’t do this alone.

Dude teams already existing base game mode by Team Garry, there are teams(red, orange, spectator team, and something else). They are just disabled by default.

You can add any feature to the already existing base gam emode. Custom player models don’t have to be part of a game mode, some are addons and will work automatically in any game mode.

If you can’t do any of this class stuff then why are you bothering to make a base gamemode? Start with something simple like a swep or a script, then learn some more lua, THEN attempt to make a gamemode base. I’m not even sure why you are bothering as all the features you have mentioned above are in the existing base gamemode. You are just reinventing the wheel here dude.

  1. well, How to enable by default all clases? you don’t know

  2. When i said Playermodels, I mean add a different playermodel depend of the class you choose. i don’t mention to use an addon to add features in the gamemode due to people usually enter in the server without addons already installed.

  3. You only come here to said that you feel bothering because i am making a team gamemode, no point go away. I want to do gamemode with classes and if it is needed with the basic derma thing to choose clases, i ask here because i tried serveral times to make a good gamemode and i need help (all the gamemodes already make have a lot of code that nobody can undestant if is not the person who make the gamemode, even if you are a lua king…then we need a team skeleton gamemode with classes and the basic derma things to work on it and do better gamemodes!).