Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-25-2012, 04:05 AM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
Need help with shoot()

I have tried testing it to see if it would shoot a arrow or anything, but it was a no go, I don't even see a shadow being shot. so if anyone could point out what i need to do to get this working, it would be nice, thanks in advance.

Also, additional constructive criticism about the script i have would be nice too. like what i should do instead, or something i should not have done on it would be helpful.


PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.equip false;
  
this.gunout false;
}

function 
onKeyPressed(codekey) {
  if (
key == "d") {
    if (
this.gunout == true) {
      
onFire();
    } else {
      
onGani();
    }
  }
  if (
key == "a") {
    
this.equip this.gunout false;
    
setani("idle"null);
    
replaceani("idle""idle");
    
replaceani("walk""walk");
    
player.chat "Gun off!";
  }
}

function 
onGani() {
  
this.equip true;
  
setani(this.gani_idlenull);
  
replaceani("idle"this.gani_idle);
  
replaceani("walk"this.gani_walk);
  
player.chat "Gun on!";
  
this.gunout true;
}

//problems below

function onFire() {
  
player.chat "Firing!";
  
setani(this.gani_firenull);
  
setshootparams("arrow"player.account);
  
temp.angle getangle(vecx(player.dir), vecy(player.dir));
  
temp.zangle pi 4;
  
temp.power 1.5;
  
shoot(player.xplayer.yplayer.ztemp.angletemp.zangletemp.power"arrow""barrow0.png");

also, whats that second parameter in setani()?
Reply With Quote
 


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 02:13 PM.


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