Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   n00bie question! (https://forums.graalonline.com/forums/showthread.php?t=62394)

excaliber7388 11-20-2005 08:00 PM

n00bie question!
 
arg i hate asking for this:
how do i properly use putnpc2?
VvVThat dun work VvV
NPC Code:
//#CLIENTSIDE
// NPC made by Excaliber
if(weaponfired){setani grab,;
putnpc2 #f,beer.txt,playerx,playery+3,{
//#CLIENTSIDE
if(playertouchsme){
playerhearts=playerhears+2;
destroy;
}
}
destroy;
}


ZeLpH_MyStiK 11-20-2005 08:10 PM

you can't have two //#CLIENTSIDE
put your script in a class npc and do a putnpc2 with if (created) join classname;

excaliber7388 11-20-2005 09:22 PM

it says that there's no NPCs that use it X_X

Skyld 11-20-2005 10:29 PM

PHP Code:

putnpc2(xy"contents"); 

... where contents will often be a join:
PHP Code:

putnpc2(xy"join(\"classname\");"); 

For old gscript, that is:
PHP Code:

putnpc2 x,y,{join classname;}; 

Quote:

Originally Posted by excaliber7388
it says that there's no NPCs that use it X_X

That just means that nothing has joined your class yet.

When you join a class that has no current instances, it will then appear in the classes list, and future script updates will then update all instances.

Riot 11-21-2005 12:13 AM

Aside from what Skyld posted, you are trying to use putnpc2 clientside, which is not possible.

excaliber7388 11-21-2005 03:17 AM

Well, i can now lay down beers. however, if the level is updated after they are 'drank' they re-appear X_X here's the two scripts:
beer weapon:
NPC Code:
if(created){join beer;}
if(actionserverside){
if(strequals(#p(0),lay)){
putnpc2 playerx,playery+3,
{join beer;};
}
}
//#CLIENTSIDE

// NPC made by Excaliber
if(weaponfired){setani grab,;playerdir=2;
triggeraction 0,0,serverside,Beer,lay;

destroy;
}


beer class:
NPC Code:
//#CLIENTSIDE
if(created){
setshape 1,32,32;
setimg beer.gif;
}
if(playertouchsme){
playerhearts=playerhearts+1;
setani hurt,;
hide;
destroy;
}


napo_p2p 11-21-2005 04:57 AM

To get rid of them, destroy has to be called serverside.

ApothiX 11-21-2005 03:08 PM

HTML Code:

if(created){join beer;}
Why exactly are you doing that?

excaliber7388 11-22-2005 12:10 AM

XD don't know i was testing something
*removed*

MysticX2X 11-22-2005 01:10 AM

haha even i could do that.


All times are GMT +2. The time now is 04:05 AM.

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