Blockland Forums > Modification Help

Interchanging items in the Tools GUI

Pages: (1/3) > >>

takato14:

I need to know how to swap out the tool I am currently using for a different one.


--- Code: ---%obj.tool[%currSlot] = GknifeBrokenItem;

--- End code ---
this arg doesnt work, how do I really do it?

MegaScientifical:

Setting a variable won't set for the model. What you're doing is like writing on a delivery sheet "This package is here." without actually putting it there.

Bauklotz:

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 ---


takato14:

I know how to remount an image. I didnt know how to replace the item. Thank you.

However, the "msgItemPickup" part plays the item pickup sound, doesnt it? Can I do this without that part of the function? I dont want the pickup sound played.

takato14:


--- Quote from: MegaScientifical on February 02, 2011, 10:02:16 PM ---Setting a variable won't set for the model. What you're doing is like writing on a delivery sheet "This package is here." without actually putting it there.

--- End quote ---
What I meant was, I wanted to change my inventory. I already change the weapon. I needed to change the item as well.

Pages: (1/3) > >>

Go to full version