View Single Post
  #7  
Old 08-04-2008, 06:58 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
hmm, use public functions i suppose and just name the weapon?
Here's an example with an inventory kind of system

Weapon Name 1
HTML Code:
function onCreated() {
  Swords = this;
}

public function onEquip() {
  //Do stuff
}
From another NPC
HTML Code:
function onEquip() {
  //Some-how find out it's a sword type of weapon you're equipping, generally by reading a string
  Swords.trigger("Equip", "");
  //Or you could do 
  Swords.onEquip();
  //However, if you didn't use that method, you'd use this 
  findWeapon("Weapon Name 1").onEquip(); //Or the trigger etc
}
Reply With Quote