This isn't really a general question looking for help or such but rather what you think so far as I have been learning to script.
The general idea of this script is to be able to save your current outfit with a specified name using the command, "/save oufit "name"" as well as load it later using the command, "/load outfit "name"". It's not finished but tell me what you think.
PHP Code:
public function test() {
}
function onCreated () {
client.head = "";
client.body = "";
client.shield = "";
client.sword = "";
}
function onPlayerChats () {
if (player.chat.starts("/save outfit")) {
player.chat.tokenize();
this.outfitname = tokens[2];
client.head.add(player.head);
client.body.add(player.body);
client.shield.add(player.shield);
client.sword.add(player.sword) ;
}
if (player.chat.starts("/load outfit")) {
player.chat.tokenize();
for(i=0;i<client.size();i++) {
player.head[i] = client.head[i];
player.body[i] = client.body[i];
player.shield[i] = client.shield[i];
player.sword[i] = client.sword[i];
}
}
}
P.S. I'm considering creating functions for each part. But Hell Raven has taught me it's best to make independent functions. Tho, I have not done so here.