View Single Post
  #1  
Old 05-29-2007, 09:08 PM
ff7chocoboknight ff7chocoboknight is offline
Skyzer Zolderon
ff7chocoboknight's Avatar
Join Date: Dec 2006
Location: New Hampshire, United States
Posts: 725
ff7chocoboknight is a name known to allff7chocoboknight is a name known to allff7chocoboknight is a name known to allff7chocoboknight is a name known to all
Send a message via AIM to ff7chocoboknight Send a message via MSN to ff7chocoboknight
Question Is this script right?

I just need the script looked over for errors. It's a harpoon weapon.
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
client.max_harpo_ammo 10;
  
client.harpo_ammo=10;
  
this.harpo_on 0;
}
function 
onWeaponFired() {
  if (
this.harpo_on 0) {
    
this.harpo_on 1;
    if (
this.harpo_on && client.harpo_ammo 0) {
      
replaceani("walk""graalaxy_harpoon_walk");
      
replaceani("graalaxy_harpoon_empty_walk""graalaxy_harpoon_walk");
      
replaceani("idle""graalaxy_harpoon_idle");
      
replaceani("graalaxy_harpoon_empty_idle""graalaxy_harpoon_idle");
      
replaceani("sword""graalaxy_harpoon_shoot");
      
replaceani("graalaxy_harpoon_empty_shoot""graalaxy_harpoon_shoot");
    } else if (
this.harpo_on && client.harpo_ammo 0) {
      
replaceani("walk""graalaxy_harpoon_empty_walk");
      
replaceani("graalaxy_harpoon_walk""graalaxy_harpoon_empty_walk");
      
replaceani("idle""graalaxy_harpoon_empty_idle");
      
replaceani("graalaxy_harpoon_idle""graalaxy_harpoon_empty_idle");
      
replaceani("sword""graalaxy_harpoon_empty_shoot");
      
replaceani("graalaxy_harpoon_shoot""graalaxy_harpoon_empty_shoot");
    }
  } else if (
this.harpo_on 1) {
    
this.harpo_on 0;
    
replaceani("graalaxy_harpoon_walk""walk");
    
replaceani("graalaxy_harpoon_empty_walk""walk");
    
replaceani("graalaxy_harpoon_idle""idle");
    
replaceani("graalaxy_harpoon_empty_idle""idle");
    
replaceani("graalaxy_harpoon_shoot""sword");
    
replaceani("graalaxy_harpoon_empty_shoot""sword");
  }
}
function 
onKeyPressed(keycodekeychar) {
  if (
this.harpo_on && keychar "r") {
    if (
client.harpo_ammo 0) {
      
setani("graalaxy_harpoon_reload"" ");
      
client.harpo_ammo client.max_harpo_ammo;
    }
  }
  if (
keychar "s" && client.harpo_ammo 0) {  
  
client.harpo_ammo -= 1;
  
setshootparams("damage"3);
  
temp.shootangle getangle(vecx(player.dir), vecy(player.dir));
  
shoot(player.x+vecx(player.dir), player.y+vecy(player.dir), player.ztemp.shootangle00"graalaxy_harpoon_arrow"NULL);
  }

__________________
Reply With Quote