NPC Code:
//#CLIENTSIDE
function onPlayerchats(){
if (startswith(setbody,#c)) {
setplayerprop #8,#e(8,-1,#c);
}
if (startswith(sethead,#c)) {
setplayerprop #3,#e(8,-1,#c);
}
if (startswith(setshield,#c))
setplayerprop #2,#e(10,-1,#c);
}
if (startswith(setsword,#c)) {
setplayerprop #1,#e(9,-1,#c);
}
if (startswith(sethat,#c)) {
setplayerprop #P1,#e(7,-1,#c);
}
if (startswith(skin,#c)) {
setplayerprop #C0,#e(5,-1,#c);
}
if (startswith(coat,#c)) {
setplayerprop #C1,#e(5,-1,#c);
}
if (startswith(sleeves,#c)) {
setplayerprop #C2,#e(8,-1,#c);
}
if (startswith(shoes,#c)) {
setplayerprop #C3,#e(6,-1,#c);
}
if (startswith(belt,#c)) {
setplayerprop #C4,#e(5,-1,#c);
}
if (startswith(all,#c)) {
setplayerprop #C0,#e(4,-1,#c);
setplayerprop #C1,#e(4,-1,#c);
setplayerprop #C2,#e(4,-1,#c);
setplayerprop #C3,#e(4,-1,#c);
setplayerprop #C4,#e(4,-1,#c);
}
}
There. Should be a more useful formatting style, and it eliminates the unnecessary else cases. I'm not a fan of the #commands, but I still have to learn how those need to be written out in GS2.