This script randomizes the weapon and it's attachment's.. This would have been great for the mystery box. I made this script through gathering bits and pieces of info in the .FF in various GSC's Hope you like it
Code:
randomWeapon()
{
name = random( level.tbl_weaponIDs );
weapon = name[ "reference" ];
giveIt = attach + "_mp";
attach = randomAttachment( name[ "reference" ], name[ "attachment" ] );
self GiveWeapon( giveIt );
}

randomAttachment( weapon, attachments )
{
	attachments = StrTok( attachments, " " );
	if ( attachments.size <= 0 )
	{
		return ( weapon );
	}
	attachment = random( attachments );
	if ( attachment == "" )
	{
		return ( weapon );
	}
		return ( weapon + "_" + attachment );
}