Ok, this script is shooting the bullet then switching to a different NPC that you have, were not sure if its the shoot command like has it changed or if there is something else in the script thats bugging it to do this, so if anyone that knows whats happening please post your input
PHP Code:
//#CLIENTSIDE
function onCreated(){
setani("idle", "");
replaceani("idle", "idle");
replaceani("walk", "walk");
this.inuse = "0";
}
function onWeaponfired(){
if (!this.inuse==1) {
setani("cross_pistol-idle", "");
replaceani("idle", "cross_pistol-idle");
replaceani("walk", "cross_pistol-walk");
this.inuse=1;
}
if (this.inuse==1) {
setani("cross_pistol-fire", "");
this.angle = "#v(getangle(vecx(playerdir),vecy(playerdir)))";
this.bulletangle = "-.2";
this.random = "random(this.bulletangle,abs(this.bulletangle))";
shoot ("playerx,playery,,this.angle+this.random,,,cross_pistol-bullets,");
freezeplayer(0.3);
sleep(0.7);
setani("cross_pistol-idle", "");
}
}
function onKeypressed(){
if (strequals(#p(1),a)&&this.inuse==1) {
setani("idle", "");
replaceani("idle", "idle");
replaceani("walk", "walk");
this.inuse=0;
}
}