State checks would have to be in repeated, every few ms checks. With about 8 players and a check every 100 milliseconds that's a lot of extra load on the server.
You'd only need my code, plus your own defining what "flagItem" is.
datablock ItemData(flagItem)
{
category = "Weapon"; // Mission editor category
className = "Weapon"; // For inventory system
// Basic Item Properties
shapeFile = "./shapes/flag.dts";
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;
//gui stuff
uiName = "";
iconName = "base/client/ui/itemIcons/wand.png";
doColorShift = true;
colorShiftColor = "0 255 0 1.000";
// Dynamic properties defined by the scripts
image = "";
canDrop = true;
};
function flagItem::onPickup(%this, %item, %obj, %amount)
{
//Extra code depending on what happens when picked up.
//Change the "image" variable in the item and add Parent::onPickup(%this, %flag, %obj, %amount);
//to the code for standard pickup including deleting item, adding to inventory, etc.
}