
06-12-2006, 05:42 AM
|
|
Okiesmokie
|
Join Date: May 2004
Posts: 1,447
|
|
Quote:
|
Originally Posted by xXziroXx
Or even a better way to make a tailoring script..
PHP Code:
function onPlayerChats()
{
tokens = player.chat.tokenize();
BodyParts = { "skin", "coat", "sleeves", "shoes", "belt", "all"};
BodyColors = { "white", "yellow", "orange", "pink", "red",
"darkred", "lightgreen", "green", "darkgreen", "lightblue",
"blue", "darkblue", "brown", "cynober", "purple",
"darkpurple", "lightgray", "gray", "black"};
if (BodyParts.index( tokens[0]) > -1 && BodyColors.index( tokens[1]) > -1) {
if (tokens[0] != "all") player.colors[ BodyParts.index( tokens[0])] = tokens[1];
else {
for (i: BodyParts) player.colors[ BodyParts.index( i)] = tokens[1];
}
player.chat = "Changed " @ tokens[0] @ " to " @ tokens[1] @ "!";
}
}
HOWEVER, good job with the tutorial!
|
I'd prefer my version of it. - You are limiting what types of colors they can change to. In Graal you can also change your color to a number instead of the color name.
- Those annoying spaces between the opening parenthesis and the first parameter. Why the HELL do you and contiga do that? It is the stupidest thing I've ever seen, and is beyond annoying to read.
|
__________________
[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
|
|
|
|