Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Script Error (https://forums.graalonline.com/forums/showthread.php?t=60573)

alissalee 08-18-2005 04:23 AM

Script Error
 
What is wrong with this script
NPC Code:

// NPC made by Jay
if (created) {}
if (playerchats && (strequals(#a,alissalee))) {}
if (strequals(#p(0),kick)) {}
with(getplayer(#p(2))){
setlevel2 reborn_startlocal,30,30;
}


Maniaman 08-18-2005 04:39 AM

1) Use are checking parameters, not the players chat.
2) You are closing the playerchats event before it has a chance to execute anything.
3) There is an empty if (created) block.

Tolnaftate2004 08-18-2005 04:43 AM

4. Your level has no file extension.

alissalee 08-18-2005 04:47 AM

NPC Code:


// NPC made by Jay
if (playerchats && strequals(#a,alissalee))) {}
if (startswith(/kick,#a)) {
with(getplayer(#p(2))){
setlevel2 reborn_startlocal.nw,30,30;
}


is that right now?

Polo 08-18-2005 12:35 PM

No.
1. You are still closing the playerchats block ({} is an empty block).
2. In the startswith, you are checking against #a (thier account), whereas you mean to put #c (thier chat).
3. Paramater 2 (#p(2)) does not exist (in the context of this script), as it is set when a triggeration or other parameter sending function gets called. You need to use tokenize, then the #t() tokens here to get the second word of the players chat.

Tolnaftate2004 08-18-2005 10:21 PM

4. You are missing a closing bracket.

konidias 08-19-2005 03:01 AM

Quote:

Originally Posted by Polo
No.
1. You are still closing the playerchats block ({} is an empty block).
2. In the startswith, you are checking against #a (thier account), whereas you mean to put #c (thier chat).
3. Paramater 2 (#p(2)) does not exist (in the context of this script), as it is set when a triggeration or other parameter sending function gets called. You need to use tokenize, then the #t() tokens here to get the second word of the players chat.

1. in my opinion, if she can't figure this out,, she shouldn't even be scripting.
2. again... why does she even bother?
3. I have to disagree here. Tokenize is totally inefficient in this situation. It would be better to use #e().

haunter 08-19-2005 03:19 AM

Quote:

Originally Posted by konidias
1. in my opinion, if she can't figure this out,, she shouldn't even be scripting.

Hey, everybody has to start somewhere... Yeah, it makes my head hurt too... But really.

alissalee 08-19-2005 03:54 AM

i am not a she good damnit every time i script it it says script error

protagonist 08-19-2005 06:28 AM

I would seriously consider picking up a C book or something like that, alissalee. They have far better guides for syntax, and many of the syntax properties of C and C++ can be carried into GS. Trust me.

alissalee 08-19-2005 08:17 AM

were can u give me a url Scriptagonist

Polo 08-19-2005 11:07 AM

Quote:

Originally Posted by konidias
3. I have to disagree here. Tokenize is totally inefficient in this situation. It would be better to use #e().

True. Perchance I was jaded by thier original use of #p().

protagonist 08-19-2005 04:59 PM

Quote:

Originally Posted by alissalee
were can u give me a url Scriptagonist

http://cplus.about.com/od/beginnerct...1/l/blctut.htm

C and C++ have alot more documentation that GScript, so you may find it easier to learn. Then, once you learn a sufficient amount, you'll be able to carry over the habits you form into GS.

alissalee 08-19-2005 05:45 PM

thxsman


All times are GMT +2. The time now is 08:13 PM.

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