Blockland Forums > Modification Help

Interchanging items in the Tools GUI

Pages: << < (2/3) > >>

takato14:


--- Quote from: Bauklotz on February 03, 2011, 03:30:00 AM ---For changing the item of %obj in inventory slot %slot with hammerItem,

--- Code: ---%obj.tool[%slot] = hammerItem.getID();
commandToClient(%obj.client, 'msgItemPickup', "", %slot, hamerItem.getID(), 1);

--- End code ---

For changing the image held in %obj's right hand with hammerImage,

--- Code: ---%obj.mountImage(hammerImage, 0);

--- End code ---

--- End quote ---
Erm, it didnt work.... I changed hammerItem to GKnifeBrokenItem (as I needed) and nothing else.

Wait, you typed hameritem; I didnt realize there were 2 spots. Revising, and testing.... nope, still didnt work. What it DID do, was make my hammer the broken version of the sword. It didnt change the icon, but it was the sword. ._.

What I want to do. Ill represent with pictures.

Before breaking:

After Breaking:


takato14:

Bump? Help? :c

Bauklotz:


--- Code: ---function player::setInventorySlot(%this, %i, %db) {
   %this.tool[%slot] = (%db = %db.getID());
   commandToClient(%this.client, 'msgItemPickup', "", %slot, %db.getID(), 1);
}

--- End code ---

%obj.setInventorySlot(0, gKnifeBrokenItem);

takato14:


--- Quote from: Bauklotz on February 05, 2011, 04:04:47 AM ---
--- Code: ---function player::setInventorySlot(%this, %i, %db) {
   %this.tool[%slot] = (%db = %db.getID());
   commandToClient(%this.client, 'msgItemPickup', "", %slot, %db.getID(), 1);
}

--- End code ---

%obj.setInventorySlot(0, gKnifeBrokenItem);

--- End quote ---
er... o.o

takato14:

Also does nothing. X_X



Pages: << < (2/3) > >>

Go to full version