Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Trouble with script (https://forums.graalonline.com/forums/showthread.php?t=61985)

excaliber7388 10-30-2005 05:02 PM

Trouble with script
 
can't get this to work, should warp player, set attributes, and gender :\
NPC Code:
// Graal2002 NPC by Excaliber
if(actionserverside){
if(strequals(#p(0),warp)){
setlevel2 begin_darkrival2.nw,31,31;
}
}
if (mousedown && leftmousebutton && mousex>x-.1 && mousex<x+2 && mousey>y-.1&&mousey<y+3){
setgender male;
sethead head.png;
setbody body.png;
enabledefmovement;
setlevel2 begin_darkrival2.nw,31,31;
hideplayer .05;
}
//#CLIENTSIDE
if (mousedown && leftmousebutton && mousex>x-.1 && mousex<x+2 && mousey>y-.1&&mousey<y+3){
setgender male;
sethead head.png;
setbody body.png;
enabledefmovement;
hideplayer .05;
triggeraction playerx,playery,serverside,warp;
}
if (created) {
showcharacter;
setcharprop #3,head0.png;
setcharprop #C0,orange;
setcharprop #C1,white;
setcharprop #C2,blue;
setcharprop #C3,red;
setcharprop #C4,black;
setcharprop #n,Male;
setcharprop #2,shield1.gif;
shieldpower = 1;
dir = 2;
}


Yen 10-30-2005 05:12 PM

Use 'actionleftmouse' in the serverside. This is called when the player left clicks the NPC.
The only part you need in the clientside is the showcharacter stuff.

Skyld 10-30-2005 05:22 PM

Also, please stop mixing conditional checks and events in single if () statements.

excaliber7388 10-30-2005 05:36 PM

so this is all i need?
NPC Code:
if (actionleftmouse && mousex>x-.1 && mousex<x+2 && mousey>y-.1&&mousey<y+3){
setgender male;
sethead head.png;
setbody body.png;
enabledefmovement;
hideplayer .05;
setlevel2 begin_darkrival2.nw,31,31;

}


because that didn't work X_X

Yen 10-30-2005 05:37 PM

actionleftmouse is called when you click on the NPC.

excaliber7388 10-30-2005 05:41 PM

still doesn't work

Yen 10-30-2005 05:45 PM

I'm a good little Yenny-poo, yes I am..
Nothing to see here, just move along..

excaliber7388 10-30-2005 05:54 PM

thats exactly what i had....not that you showed anything ;)

ZeLpH_MyStiK 10-30-2005 06:13 PM

stop using leftmousebutton with mousedown...mousedown carries a #p(0) along with it to show which mouse is being pressed.

excaliber7388 10-30-2005 06:16 PM

oh thanks.
however, this did not help

Skyld 10-30-2005 06:39 PM

Then stop depending so much on people to do the work for you, and do some thinking of your own too.

excaliber7388 10-30-2005 06:56 PM

Quote:

Originally Posted by Skyld
Then stop depending so much on people to do the work for you, and do some thinking of your own too.

i made the script in the first place, and it works perfectly offline, however online it does not work

Skyld 10-30-2005 07:00 PM

Quote:

Originally Posted by excaliber7388
i made the script in the first place, and it works perfectly offline, however online it does not work

That is no reason not do some thinking of your own...?

excaliber7388 10-30-2005 07:04 PM

i don't know whats wrong, from everything i know, this script should work...i'm guessing you know why it doesn't? :\

ZeLpH_MyStiK 10-30-2005 08:48 PM

Quote:

Originally Posted by excaliber7388
i don't know whats wrong, from everything i know, this script should work...i'm guessing you know why it doesn't? :\

yes...you're using it wrong


All times are GMT +2. The time now is 10:47 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.