Blockland Forums > Modification Help
Sorry wrong section, locked.
(1/1)
The Russian:
Okay so I've been stuck on this piece of code for a very long time and I can't figure out what's wrong. This is supposed to switch two people's inventories based on how many inventory slots they both have (must have the same amount) and it's been derping.

--- Code: ---//%client and %user are two clients

%client.player.naToolCount = 0;
while(%client.player.naToolCount < %client.player.getDataBlock().maxtools)
{
%client.player.BDtool = %client.player.tool[%client.player.naToolCount];
%user.player.BDtool = %user.player.tool[client.player.naToolCount];
%client.player.tool[%client.player.naToolCount] = %user.player.BDtool;
%user.player.tool[%client.player.naToolCount] = %client.player.BDtool;
messageClient(%client, 'MsgItemPickup', '', %client.player.naToolCount, %client.player.tool[%client.player.naToolCount]);
messageClient(%user, 'MsgItemPickup', '', %client.player.naToolCount, %user.player.tool[%client.player.naToolCount]);
%client.player.naToolCount++;
}

%client.player.BDtool = "";
%user.player.BDtool = "";
%client.player.naToolCount = "";
--- End code ---
The problem is that, after it executes, the fields storing the ID of the item on %user's player are completely gone (according to dump();) and the %client still has his but can't see them (he's not being messaged about them properly). Can anybody shed some light on this for me?
Lugnut:
wrong section, goes in coding help.

you'll get more help over there.
The Russian:

--- Quote from: Lugnut1206 on June 05, 2012, 08:42:56 PM ---wrong section, goes in coding help.

you'll get more help over there.

--- End quote ---
Whoops, I just realized that, locking.
Navigation
Message Index

Go to full version