Jump to content
  • 0

Why isn't this script working?


EmptyRaiden

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  09/23/15
  • Last Seen:  

Hello,

 

I'm new at scripting NPC's and I need some help on some basic stuff.

 

This is my script of a basic monster invasion NPC:

prontera,160,187,4	script	MI	100,{

if(getgmlevel() < 50) { goto notgm; }
		 else { goto gm; }

gm:
mes "[^FF0000MI^000000]";
mes "Hello, GM, what can I do for you?";
cloes;
end;

notgm:
mes "[^FF0000MI^000000]";
mes "Hello, I'm NPC of Monster Invasion event.";
mes "You can excpet me starting the event on (s) and (s) at 8:00 PM";
close;
end;}

tried to do this too:

prontera,160,187,4	script	MI	100,{

if(getgmlevel() < 50) { goto notgm; }
		 else { mes "[^FF0000MI^000000]";
			mes "Hello, I'm NPC of Monster Invasion event.";
			mes "You can excpet me starting the event on (s) and (s) at 8:00 PM"; cloes;}

gm:
mes "[^FF0000MI^000000]";
mes "Hello, GM, what do you want me to do?";
cloes;
end;
}

And yes, this isn't the full script 'cause I'm already stuck at this part. Well, the problem is when I ever click of the NPC, nothing happens at all when it supposed to do the script  (talking to you after knowing your gm level so it affects the way it behaves).

 

 

Thanks.

Edited by Anqayas
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

First you write close; as cloes; in the gm: label

2nd you didn't need end when closing dialog, close is enough

prontera,160,187,4	script	MI	100,{

	if(getgmlevel() < 50) {
		mes "[^FF0000MI^000000]";
		mes "Hello, I'm NPC of Monster Invasion event.";
		mes "You can excpet me starting the event on (s) and (s) at 8:00 PM";
		close;
	}
	mes "[^FF0000MI^000000]";
	mes "Hello, GM, what can I do for you?";
	close;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  09/23/15
  • Last Seen:  

What a mistake! cloes instead of close, I must've been drunk or something lol.

Anyway thanks it worked perfectly.

 

Just one more thing, why didn't you use "else"?

Edited by Anqayas
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   2
  • Joined:  04/21/15
  • Last Seen:  

If you will look closely, the code does not call the gm/notgm function anymore.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...