Or we can do it the easy way, and actually make it work.
$PossibleItem[$MaxItems++] = "";
$PossibleItem[$MaxItems++] = "";
$PossibleItem[$MaxItems++] = "";
function giverandomitem(%client)
{
%tool = $PossibleItem[getRandom(1,$MaxItems)];
for(%i=0;%i<%client.player.getDataBlock().maxTools; %i++)
{
if(%client.player.tool[%i] == 0)
{
%client.player.tool[%i] = %tool;
if(%tool.className $= "Weapon")
%client.player.weaponCount++;
messageClient(%client,'MsgItemPickup','',%i,%tool);
break;
}
}
}
No, you just missed the point. They're not supposed to give actual tools(items). So, read his outline again.
And the rest is just preference.