Author Topic: I need some help with *script merging  (Read 2521 times)

for
Code: [Select]
if(%player.getMountedImage(2) $= nametoID(PiehatImageImage))it should probably be
Code: [Select]
if(%player.getMountedImage(2) == PiehatImageImage.getid())
Not really sure if nameToID actually exists.

Also, does %player even exist?

nameToID does exist. It is found in the batman hat, the dovahkiin hat, and the waluigi time hat.
%player exists too, otherwise why would all the aforementioned addons work?

I need some help with merging the two pieces of code with functional brackets and no syntax errors.

Code: [Select]
function serverCmdWearPieHat(%client) {
if(%client.player.getMountedImage(2) $= PiehatImage.getID()) {
%client.player.unmountImage(2);
%client.applyBodyParts();
%client.applyBodyColors();
return;
}
if(%client.piesEaten >= 100 || %client.isAdmin) {
%client.player.mountImage(PieHatImage, 2);
messageClient(%client, '', "<color:FFFF00>You put on the PIE HAT.");

for(%i = 0; $hat[%i] !$= ""; %i++) {
%client.player.hideNode($hat[%i]);
if($accent[%i] !$= "")
%client.player.hideNode($accent[%i]);
}
}
else {
messageClient(%client, '', "<color:FFFF00>You do not have enough pies.");
}
}

It doesn't need to be inside a package.
« Last Edit: August 21, 2013, 07:21:52 PM by $trinick »

It doesn't need to be inside a package.
It only should if it overwrites another function.