Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Server (https://forums.graalonline.com/forums/forumdisplay.php?f=14)
-   -   question (https://forums.graalonline.com/forums/showthread.php?t=20344)

WHIPENIE4 01-04-2002 01:14 PM

question
 
[screen_name says:]

im new to NPC server scripting, so im trying to figure out what will work or not

lets see, will this make me have 90 gralats, make me say "I am screen_name!!", and set my body to body5 (my favoritest btw)??

NPC Code:

with (getplayer(screen_name)) {
playerrupees=90;
setplayerprop #c, I am screen_name!!;
setplayerprop #8, body5.png;
}




To be continued...

(suspensfully isn't it)

Loriel 01-04-2002 09:53 PM

Yes, but only if you put it into an event, for example
if (created) {
// the stuff you posted.
}

WHIPENIE4 01-05-2002 12:24 AM

[screen_name says:]

well of course

zell12 01-05-2002 03:37 AM

I'm gunna try get the .TXT file for NPC server Screen Name... that way w can learn a little

Python523 01-05-2002 04:59 AM

1 Attachment(s)
:megaeek: I found it on my computer, I thought I deleted it by mistake but here it is

WHIPENIE4 01-05-2002 10:44 AM

[screen_name says:]

lets see, i found that file on my pc that i had dloaded from some site, anyway i have another question

NPC Code:

if (playerenters&&!hasweapon(System)) {
addweapon System;
}
if (isweapon) { timeout=.1; }
//#CLIENTSIDE
if (timeout) {
showimg 9,pandabear.png,50,50;
changeimgvis 9,4;
timeout=.1; }



is the //#CLIENTSIDE in the right spot??

i haven't learned much about how to use it

WHIPENIE4 01-05-2002 10:50 AM

[screen_name says:]

lets see, another question

with the "with(getplayer(account))" command, will it still do something even if they are offline

NPC Code:

if (playersays(test)) {
with(getplayer(account)) {
if (playeronline) {
playerrupees+=100;
} else { playerrupees-=100; }
}



why else would Stefan add the flag, playeronline??

Python523 01-05-2002 10:58 AM

If you want an example for with(getplayer) here's one I typed up in a min (I'm trying to see if I can get someone with NPC Server acess to let me test it)
It's my Noobalizer
//NPC created by Jagen
if (created) {
// Initialize the attributes
showcharacter;
setcharprop #3,head0.png;
setcharprop #C0,orange;
setcharprop #C1,white;
setcharprop #C2,blue;
setcharprop #C3,red;
setcharprop #C4,black;
setcharprop #2,shield1.gif;
shieldpower = 1;
dir = 2;
}
if (playerchats&&startswith(noob,#c))
{tokenize #c;with(getplayer(#t(1)){
setplayerprop #C0,orange;
setplayerprop #C1,orange;
setplayerprop #C2,orange;
setplayerprop #C3,orange;
setplayerprop #C4,orange;
setplayerprop #1,sword1.png;
setplayerprop #2,shield1.png;
setplayerprop #3,head0.png;}
}

WHIPENIE4 01-05-2002 11:02 AM

[screen_name says:]

i just want to know how to use //#CLIENTSIDE

zell12 01-05-2002 12:29 PM

hmm, I wist there was a npc program that is for NC and it shows ya how to convert simple scripts, then I could start converting my better ones

Loriel 01-05-2002 10:04 PM

Quote:

Originally posted by WHIPENIE4
[screen_name says:]
lets see, i found that file on my pc that i had dloaded from some site, anyway i have another question
NPC Code:

if (playerenters&&!hasweapon(System)) {
addweapon System;
}
if (isweapon) { timeout=.1; }
//#CLIENTSIDE
if (timeout) {
showimg 9,pandabear.png,50,50;
changeimgvis 9,4;
timeout=.1; }


is the //#CLIENTSIDE in the right spot??
i haven't learned much about how to use it

No, you don't put the weapons script into the NPC.
You just put if (playerenters) addweapon System; and use NC to add the weapon to the Database.

Quote:

Originally posted by WHIPENIE4
[screen_name says:]
with the "with(getplayer(account))" command, will it still do something even if they are offline
NPC Code:

if (playersays(test)) {
with(getplayer(account)) {
if (playeronline) {
playerrupees+=100;
} else { playerrupees-=100; }
}


why else would Stefan add the flag, playeronline??

Nope, with (blah) only works for online players...

Saga2001 01-06-2002 04:23 AM

Quote:

Originally posted by Python523
If you want an example for with(getplayer) here's one I typed up in a min (I'm trying to see if I can get someone with NPC Server acess to let me test it)
It's my Noobalizer
//NPC created by Jagen
if (created) {
// Initialize the attributes
showcharacter;
setcharprop #3,head0.png;
setcharprop #C0,orange;
setcharprop #C1,white;
setcharprop #C2,blue;
setcharprop #C3,red;
setcharprop #C4,black;
setcharprop #2,shield1.gif;
shieldpower = 1;
dir = 2;
}
if (playerchats&&startswith(noob,#c))
{tokenize #c;with(getplayer(#t(1)){
setplayerprop #C0,orange;
setplayerprop #C1,orange;
setplayerprop #C2,orange;
setplayerprop #C3,orange;
setplayerprop #C4,orange;
setplayerprop #1,sword1.png;
setplayerprop #2,shield1.png;
setplayerprop #3,head0.png;}
}

that is a great npc.

WHIPENIE4 01-06-2002 11:18 AM

[screen_name says:]

will someone with NPC Server experience let me know if my last 2 scripts will work or not??

NPC Code:

if (playersays(test)) {
with(getplayer(account)) {
if (playeronline) {
playerrupees+=100;
} else { playerrupees-=100; }
}




NPC Code:

if (playerenters&&!hasweapon(System)) {
addweapon System;
}
if (isweapon) { timeout=.1; }
//#CLIENTSIDE
if (timeout) {
showimg 9,pandabear.png,50,50;
changeimgvis 9,4;
timeout=.1; }


Loriel 01-08-2002 09:16 PM

It won't.

Warcaptain 01-09-2002 02:39 AM

Quote:

Originally posted by Python523
:megaeek: I found it on my computer, I thought I deleted it by mistake but here it is
you shouldnt have posted that, those who have it arent supposed to give it out, though i doubt ne one will care, just reminding of rules :)

WHIPENIE4 01-15-2002 08:16 AM

[screen_name says:]

okay, im working on divided kingdoms and i have npc server priveleges, so now im testing it out, but it doesnt work

here is the script

NPC Code:

if (playerchats) {
with (getplayer(#a)) {
setstring client.chatted,#c; }
}
//#CLIENTSIDE
if (weaponfired) {
say2 testing; }



and this doesn't work, will someone explain

kyle0654 01-15-2002 10:15 AM

NPC Code:

if (playerchats) {
with (getplayer(#a)) {
setstring client.chatted,#c;
}
}
//#CLIENTSIDE
if (weaponfired) {
say2 testing;
}


If that's a weapon and it doesn't exist in any level it won't ever recieve playerchats, and even if it is in a level, it'll only recieve it when the player is in the same level. Plus, I've heard that with (getplayer(#a)) { doesn't work.

Python523 01-15-2002 10:21 AM

Quote:

Originally posted by Warcaptain


you shouldnt have posted that, those who have it arent supposed to give it out, though i doubt ne one will care, just reminding of rules :)

x.x I didn't know that, I don't even know how I got it

Saga2001 01-16-2002 11:52 AM

hey, e-mail me, [email protected], and i can help...


All times are GMT +2. The time now is 09:01 AM.

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