Thanks for all your help guys!
It works fine now.. I've also added some stuff
NPC Code:
//#CLIENTSIDE
function onCreated() {
this.speed = 1;
this.disabled = true;
}
function onWeaponFired() {
if (this.disabled)
player.chat = "Boots on!";
this.speed = 1;
this.disabled = false;
setTimer(0.05);
}
function onTimeout() {
if (!this.disabled) {
for (i = 0; i < 4; i++) {
if (keydown(i)) {
player.dir = i;
player.x += vecx(player.dir)*this.speed;
player.y += vecy(player.dir)*this.speed;
}
setTimer(0.05);
}
}
}
function onKeyPressed(code, key) {
if (key == "f" && player.weapon.name == "Personal/Pelikano/Wall") {
this.disabled = true;
player.chat = "Boots off!";
}
if (key == "1" && player.weapon.name == "Personal/Pelikano/Wall" && this.disabled == false) {
this.speed = 1;
player.chat = "Speed 1!";
}
if (key == "2" && player.weapon.name == "Personal/Pelikano/Wall" && this.disabled == false) {
this.speed = 2;
player.chat = "Speed 2!";
}
if (key == "3" && player.weapon.name == "Personal/Pelikano/Wall" && this.disabled == false) {
this.speed = 2;
player.chat = "Speed 3!";
}
}
As I said above it works fine, thanks
