Thread: Dark Rival
View Single Post
  #191  
Old 04-25-2006, 09:10 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Quote:
Originally Posted by xXziroXx
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.
I'll try it ^_^ I havn't had any server problems in a long while, so it should be fire
Reply With Quote