Giving a team "Points" for a kill?

Hey guys so im working on a custom gamemode, Currently im using a table for my teams:


teams = {}

teams[0] = {name = "Blue", playercolorz = {Vector(.2, .2, 1.0)}, weapons = {"weapon_pistol"}, playermodel = {"models/player/kleiner.mdl"}, spawnpoint = Vector(702.911560, -177.432617, 61.586304) }
teams[1] = {name = "Red", playercolorz = {Vector(1.0, .2, .2)}, weapons = {"weapon_pistol"}, playermodel = {"models/player/kleiner.mdl"}, spawnpoint = Vector(1552.912231, -144.970062, 85.309647) }
teams[2] = {name = "Waiting", playercolorz = {Vector(1.0, 1.0, 1.0)}, weapons = {"weapon_crowbar"}, playermodel = {"models/player/kleiner.mdl"}}



I was just wandering what the best way too go about giving a team points and then resetting the teams points?

Thanks in advance!

Adiminium

Theres a automatic system already made in gmod for this.

You would start with team.Setup

Im fully aware of that, What im asking is how i would implement it into my table.

Edit: Im not making myself clear enough, What im asking for is methods of adding points, clearing team points etc

do something like

[lua]
GM.Teams = {
Data = {}
}

function GM.Teams:Register( team_data )
// The name variable, we take out the spaces for the ENUM.
local name = string.gsub( team_data.Name, " ", “” );

// You need somewhere to place your data
table.insert( self.Data, team_data );

team.SetUp( #self.Data, team_data.Name, team_data.Color );

// Establishing the ENUM; TEAM_RED = 1
_G[ "TEAM_"..string.upper( name ) ] = #self.Data;

end

function GM.Teams:GetData( team_name )
for k,v in pairs( self.Data ) do
if ( v.Name == team_name ) then
return v;
end
end

return nil;

end

// Register its actual team
GM.Teams:Register({
Name = “Red”,
Color = Color( 220, 50, 50 ),
RandomVariable = “cats”,
})

// Examples you can use

ply:SetTeam( TEAM_RED );

team.AddScore( TEAM_RED );

team.GetScore( TEAM_RED );

print( GM.Teams:GetData( “Red” ).RandomVariable );

[/lua]