First Gamemode - Error - Tried to use a NULL entity!

NEVERMIND! I was just bein’ a dingus and made “self:SetTeam(n)” “self.SetTeam(n)” in player.lua

Hi, I’m having an issue with my gamemode.
When I join my server running it, the model gets selected just fine, but I have it set up so that it should change the model’s color upon joining team 1 which does not happen.
Here’s what is thrown:


[ERROR] gamemodes/jumpman/gamemode/player.lua:6: Tried to use a NULL entity!
 1. SetTeam - [C]:-1
  2. SetGamemodeTeam - gamemodes/jumpman/gamemode/player.lua:6
   3. unknown - gamemodes/jumpman/gamemode/init.lua:14

Here are my files:

cl_init.lua


include("shared.lua")

init.lua


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

include("shared.lua")
include("player.lua")

function GM:PlayerConnect( name, ip )
    print("Player " .. name .. " has joined the game.")
end

function GM:PlayerInitialSpawn( ply )
    print("Player " .. ply:Nick() .. " has spawned")
    
    ply:SetGamemodeTeam(1)
end

function GM:PlayerAuthed( ply, steamID, uniqueID )
    print("Player " .. ply:Nick() .. " is authed")
end

function GM:PlayerSetModel(ply)
    ply:SetModel("models/player/group01/male_07.mdl")
end

player.lua


local ply = FindMetaTable("Player")

function ply:SetGamemodeTeam(n)
    if n < 0 or n > 1 then return false end
    
    self.SetTeam(n)
    
    if n == 0 then
        self:SetPlayerColor(Vector(.2,.2,1.0))
    elseif n == 1 then
        self:SetPlayerColor(Vector(1.0,.2,.2))
    end
    
    return true
end

shared.lua


GM.Name = "JumpMan"
GM.Author = "Sam Cyanide"
GM.Email = "N/A"

team.SetUp(0, "Jumpers", Color(0,0,255))
team.SetUp(1, "Punchers", Color(255,0,0))

function GM:Initialize()
    self.BaseClass.Initialize( self )
end

Thanks.

-snip-

self**:SetTeam( n ) not self.**SetTeam( n )

[editline]23rd July 2013[/editline]

Else you’d have to do self.SetTeam( self, n )

[editline]23rd July 2013[/editline]

Oh you already figured it out. You should mark the thread as solved.