Thread: Little Problem!
View Single Post
  #5  
Old 05-21-2002, 10:46 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
I wouldn't have either. Also a note to screen name, its else if not elseif, though I am not sure it matters...
Also you should try to only test something once in a script, unless you have statements where you test if its not true and playertouchsme and you test if it is true and playertouchs me, otherwise both or one probably not the one you want will be executed.
For example:
NPC Code:

// way one:
if (playertouchsme && thisistrue) unset thisistrue;
if (playertouchsme && !thisistrue) set thisistrue;
sleep .05;
// way two:
if (playertouchsme) {
if (thisistrue) unset thisistrue;
else set thisistrue;
sleep .05;
}
// way three:
if (playertouchsme) {
if (thisistrue) unset thisistrue;
if (!thisistrue) set thisistrue;
sleep .05;
}
// way four and the most complicated way:
if (created)
setstring this.displays,"Hello Message A","Hello Message B";
if (playertouchsme) {
this.disp = (thisistrue ? 1 : 0);
showMessage();
sleep .05;
}
function showMessage()
say2 #I(this.displays, this.disp);



See there are many sides of one coin.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote