Table index returns nil

After adding some roles this table now returns nil, any clue why?



alloweddoorgroup = {};
alloweddoorgroup[ TEAM_LPOLICE ] = true;
alloweddoorgroup[ TEAM_LCHIEF ] = true;
alloweddoorgroup[ TEAM_SWAT ] = true;
alloweddoorgroup[ TEAM_SCHIEF ] = true;
alloweddoorgroup[ TEAM_MAYOR ] = true;

function ENT:StartTouch( target )
if ( !IsValid( target) || !target:IsPlayer( ) ) then return; end
if !( alloweddoorgroup[ target:Team( ) ] ) then
	self:SetCollisionGroup( COLLISION_GROUP_NONE )
end
if ( alloweddoorgroup[ target:Team( ) ] ) then
	self:SetCollisionGroup( COLLISION_GROUP_DEBRIS )
end
end



[lua]
//example
//Make sure you have defined all possibilities from Player:Team()
alloweddoorgroup = {};
alloweddoorgroup[ TEAM_LPOLICE ] = true; // 1
alloweddoorgroup[ TEAM_LCHIEF ] = true; // 2
alloweddoorgroup[ TEAM_SWAT ] = true; // 3
alloweddoorgroup[ TEAM_SCHIEF ] = true; // 4
alloweddoorgroup[ TEAM_MAYOR ] = true; // 5

function ENT:StartTouch( target )
if ( !IsValid( target) || !target:IsPlayer( ) ) then return; end
if !( alloweddoorgroup[ target:Team( ) ] /* if target:Team() == 6 then you called a nil index */ ) then
self:SetCollisionGroup( COLLISION_GROUP_NONE )
end
if ( alloweddoorgroup[ target:Team( ) ] ) then
self:SetCollisionGroup( COLLISION_GROUP_DEBRIS )
end
end

[/lua]