Post the full error and/or how you're using this.
I had a command on a GUI to make this function go.
function player::addItem( %this, %tool )
{
if ( !isObject( %tool ) )
{
return;
}
%tool = %item.getID(gunItem);<---Where I thought you would put the item %slots = %this.getDataBlock().maxTools;
for ( %i = 0 ; %i < %slots ; %i++ )
{
if ( !isObject( %this.tool[ %i ] ) )
{
%this.tool[ %i ] = %tool;
if ( isObject( %cl = %this.client ) )
{
messageClient( %cl, 'MsgItemPickup', '', %i, %tool );
}
break;
}
}
}