I need some help with my code. Simply it doesnt work.

I have an entity in the map im playing its name is “es1” with the obsolete pic


team.SetUp( 1, test, Color (0, 0, 255, 255))

team.SetSpawnPoint( test, "es1" )


AddCSLuaFile( "shared.lua" )
AddCSLuaFile( "cl_init.lua" )
include( 'shared.lua' )

function spawn1( pl )
    pl:SetTeam( 1 )

add.concommand( spawn1, "spawn1" )

If anyone knows how to get this work please edit it to gmod wiki team.SetSpawnPoint desc.

And ofc reply how to get it work


There are a couple things wrong with this:

  1. It’s concommand.Add(), not add.concommand().
  2. The second argument of team.SetUp() should be a string, use “” around test.
  3. The first argument of the team.SetSpawnPoint() should me the team ID, so use 1.
  4. The concommand.Add() arguments should be: String command, Func callback. So do this instead: concommand.Add( “spawn1”, spawn1 )

I hope I didn’t miss anything, there seems to be a butt ton of things wrong here.