Author Topic: Adding items to player's inventory  (Read 403 times)

For some reason adding items is such a pain in the ass. I've been doing this:

%player.tool[0] = nametoId(GunImage); and nothing happens. It never updates, never adds to inventory. I don't understand why. What am I forgetting.

That just sets a server sided variable. It's in your inventory, but your client doesn't know it is.

Look at Event_addItem to see what else you have to do

Code: [Select]
function Player::setItem(%this,%item) {
if(isObject(%this)) {
            %player.tool[0]=GunItem.getID();
messageClient(%this.client,'MsgItemPickup','',0,GunItem.getID());


}
}
Adds the item image to the inventory, but scrolling over it does nothing, just shows whatever item was used in the slot before.

%player isn't set to anything

%player isn't set to anything
holy stuff i did not catch that thank you