Anyways, new problem
I need it to be so when you say /wearPiehat and you already have the pie on, it takes it off.
But if you don't have it on, then it puts it on.
I have 2 peices of code but I dont know how to merge them to have the functionality that I want
package PieHat
{
function serverCmdwearPieHat(%client)
{
if(%client.piesEaten >= 100||%client.isAdmin||%client.isSuperAdmin)
{
%client.player.unmountImage(2);
%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]);
%client.player.hideNode($accent[%i]);
}
}
else
{
messageClient(%client,'',"<color:FFFF00>You do not have enough pies.");
}
}
};
ActivatePackage(PieHat);
{
if(%player.getMountedImage(2) $= nametoID(PiehatImageImage))
{
%player.unmountImage(2);
%client.applyBodyParts();
%client.applyBodyColors();
}
else
{
%player.unmountImage(2);
%player.mountImage(PiehatImageImage,2);
for(%i = 0;$hat[%i] !$= "";%i++)
{
%player.hideNode($hat[%i]);
%player.hideNode($accent[%i]);
}
}
}
Any help?