Why is my console showing this as an error? (small error)

Hello!

Basically, I have an addon installed which is called ChatColors and so everytime you use /<colour> <message> it will show the message in that colour (e.g… /red Hello World!).

Here is the error:
[lua][ERROR] addons/chatcolors/lua/autorun/chatcolors.lua:38: attempt to call method ‘Team’ (a nil value) 1. fn - addons/chatcolors/lua/autorun/chatcolors.lua:38
2. unknown - addons/ulib/lua/ulib/shared/hook.lua:109[/lua]

Here is the line of the error:
[lua] chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), green, ": " … suffixgreen )[/lua]

Here is the whole if statement:
[lua] if ( prefixgreen == “/green” ) then chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), green, ": " … suffixgreen )

		return true;
	end

[/lua]

Here is the whole code:
[lua]if ( SERVER ) then AddCSLuaFile( “autorun/ChatColors.lua” )
end

if ( CLIENT ) then
local red = Color( 255, 0, 0 )
local green = Color( 0, 255, 0 )
local blue = Color( 0, 115, 255 )
local yellow = Color( 255, 255, 0 )
local orange = Color( 255, 125, 14 )
local purple = Color( 130, 0, 255 )
local pink = Color( 255, 70, 255 )

hook.Add( "OnPlayerChat", "Colors", function( pl, text )
	local prefixred = text:sub( 1, 4 )
	local prefixgreen = text:sub( 1, 6 )
	local prefixblue = text:sub( 1, 5 )
	local prefixyellow = text:sub( 1, 7 )
	local prefixorange = text:sub( 1, 7 )
	local prefixpurple = text:sub( 1, 7 )
	local prefixpink = text:sub( 1, 5 )


	local suffixred = text:sub( 6, #text )
	local suffixgreen = text:sub( 8, #text )
	local suffixblue = text:sub( 7, #text )
	local suffixyellow = text:sub( 9, #text )
	local suffixorange = text:sub( 9, #text )
	local suffixpurple = text:sub( 9, #text )
	local suffixpink = text:sub( 7, #text )
	
	if ( prefixred == "/red" ) then
		chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), red, ": " .. suffixred )


		return true;
	end


	if ( prefixgreen == "/green" ) then
		chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), green, ": " .. suffixgreen )


		return true;
	end


	if ( prefixblue == "/blue" ) then
		chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), blue, ": " .. suffixblue )


		return true;
	end


	if ( prefixyellow == "/yellow" ) then
		chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), yellow, ": " .. suffixyellow )


		return true;
	end


	if ( prefixorange == "/orange" ) then
		chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), orange, ": " .. suffixorange )


		return true;
	end


	if ( prefixorange == "/purple" ) then
		chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), purple, ": " .. suffixpurple )


		return true;
	end


	if ( prefixpink == "/pink" ) then
		chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), pink, ": " .. suffixpink )


		return true;
	end

—CAPITAL LETTER FUNCTIONS DOWN HERE—

	if ( prefixred == "/RED" ) then
		chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), red, ": " .. suffixred )


		return true;
	end


	if ( prefixgreen == "/GREEN" ) then
		chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), green, ": " .. suffixgreen )


		return true;
	end


	if ( prefixblue == "/BLUE" ) then
		chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), blue, ": " .. suffixblue )


		return true;
	end


	if ( prefixyellow == "/YELLOW" ) then
		chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), yellow, ": " .. suffixyellow )


		return true;
	end


	if ( prefixorange == "/ORANGE" ) then
		chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), orange, ": " .. suffixorange )


		return true;
	end


	if ( prefixorange == "/PURPLE" ) then
		chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), purple, ": " .. suffixpurple )


		return true;
	end




	if ( prefixpink == "/PINK" ) then
		chat.AddText(team.GetColor( pl:Team( ) ), pl:Name( ), pink, ": " .. suffixpink )


		return true;
	end
end )

end[/lua]