HTML Code:
function onPlayerChats ()
{
if (player.chat.starts("/save outfit"))
{
temp.styleName = player.chat.substring("/save outfit".length()); //I got lazy!
for (temp.i = 0; temp.i < 5; temp.i++)
client.(@"outfits_"@ temp.styleName).add(player.colors[temp.i]);
client.(@"outfits_"@ temp.styleName).add({player.headimg, player.bodyimg, player.shieldimg. player.swordimg});
}
elseif (player.chat.starts("/load outfit"))
{
temp.styleName = player.chat.substring("/save outfit".length()); //I got lazy!
temp.outfitInfo = client.(@"outfits_"@ temp.styleName);
temp.outfitParts = {"head", "body", "shield", "sword"};
for (temp.currentPart: temp.outfitParts)
player.(@temp.currentPart @"img") = temp.outfitInfo[temp.outfitParts.index(temp.currentPart) + 5];
for (temp.i = 0; temp.i < 5; temp.i++)
player.colors[temp.i] = temp.outfitInfo[temp.i];
}
}
I have no idea if it'll work