I am not really good with gscript, and I have not used it for years, so I have a few questions. I have made a few changes to your code, could you explain to me why you did not write it that way?
Quote:
|
Originally Posted by Velox Cruentus
NPC Code:
//#CLIENTSIDE
if (created)
this.speed = 0.5;
if (weaponfired) {
timeout = 0.05 - timeout;
tokenize Off On;
setplayerprop #c,Boots #t(timeout * 20);
}
if (timeout) {
for (direction = 0; direction < 4; direction ++) {
playerx += keydown(direction) * vecx(direction) * this.speed;
playery += keydown(direction) * vecy(direction) * this.speed;
}
timeout = 0.05;
}
if (playerchats) {
if (startswith(/boots, #c)) {
newSpeed = strtofloat(#e(7,-1,#c));
if (newSpeed > 0) {
this.speed = newSpeed;
} else {
index = indexof(#e(7,-1,#c), off on);
if (index in {0, 4})
timeout = 0.05 * (index / 4);
}
}
}
|