View Single Post
  #10  
Old 08-28-2002, 03:47 PM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Re: Any ideas why it does not work.

Quote:
Originally posted by Spark910
NPC Code:

if (mousex=>27&&mousex=<28&&mousey=>37&&mousey=<38) {
setstring server.npc,One;
timeout=.05;
}
else {
setstring server.npc,;
unset string;
}


NPC Code:

if (mousex=>31&&mousex=<32&&mousey=>37&&mousey=<38) {
setstring server.npc,Two;
timeout=.05;
}
else {
setstring server.npc,;
unset string;
}


I guess you tried this offline/as a non-server script, so the problem is not the client/serverside part.
But when your mouse is over the first NPC this will be executed:

1. Script: (mouse is over it)
NPC Code:

setstring server.npc,One;



2. Script: (mouse is not over it)
NPC Code:

setstring server.npc,;
unset string;



Since they are both executed after each other, the second script would remove the effect of the first one.
You could solve it by only clearing the string when the mouse just left the NPC, but not always when the mouse is not over it.
Just do "this.mouseoverme = true;" when the mouse was moved over it and when the mouse is not over the NPC, you should check this variable first: "if(mousex>... && this.mouseoverme == true) {"
Then you could clear the string...and you shouldn't forget to set the variable to false again.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote