I'm trying to script up a shop system, that by typing /buyitem (Or /buygun for example) that it deducts cash from the person, and gives that person the gun.
Everything in the script is working, exept for the fact that once you get the gun, and it shows up in your inventory, but you can't use it, or even scroll to it.
for(%i = 0; %i < 5; %i++)
{
%toolDB = %client.player.tool[%i];
if(!%toolDB)
{
%client.player.tool[%i] = gunItem;
%client.player.weaponCount++;
messageClient(%client.player.client, 'MsgItemPickup', '', %i, gunItem);
%client.cash = %client.cash - %cost;
break;
}
}
Thats the part of the code that I think is stuffing up.