Jump to content
  • 0

Why isn't this script working?


Question

Posted (edited)

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

3 answers to this question

Recommended Posts

Posted

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;

}

Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...