Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-08-2006, 11:23 PM
lordspawn lordspawn is offline
Registered User
Join Date: Aug 2004
Posts: 24
lordspawn is on a distinguished road
Shooting Glitch

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;
  }

Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:41 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.