Thread: Dark Rival
View Single Post
  #190  
Old 04-25-2006, 07:25 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
In the Control-NPC, just do this:


NPC Code:

function onActionPlayerOnline()
{
this.oldNames = {"Bomb", "Bow"};
this.newNames = {"Weapons/Bomb", "Weapons/Bow"};
for (this.i = 0; this.i < this.oldNames.size(); this.i ++)
{
if ( hasweapon( this.oldNames[this.i]) ) {
removeweapon( this.oldNames[this.i]);
addweapon( this.newNames[this.i]);
}
}
}




If it lags, remove it. This is the best way to replace all your new items with old, and I doubt it will cause any lag.. I have more then one loop in my Control-NPC, and several other stuff and that doesnt cause any lag.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote