Jump to content
  • 0

Different mes for duplicate from same npc.


Question

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

If Statements

if(strcharinfo(3) == "payon"){
	do payon stuff
}
else if(strcharinfo(3) == "prontera"){
	do prontera stuff
}
else if(strcharinfo(3) == "alberta"){
	do alberta stuff
}

IF + Switch Statements

if(strcharinfo(3) == "payon"){ set .@town,1; }
if(strcharinfo(3) == "prontera"){ set .@town,2; }
if(strcharinfo(3) == "alberta"){ set .@town,3; }

switch(.@town){
	
	case 1:
		payon here
	case 2:
		prontera here
	case 3:
		alberta here
}

Just do which ever will look cleaner and easier to follow, I'd pick the combo with switch if it was me though

Edited by Hijirikawa
  • 0
Posted

yes, ... depend on how you want to do it.

 

 

Yup, you can do some if statements to check where the npc or player using the script is.

 

Could i know how?

example:

Just the same NPC, duplicated it in different Town, it said different dialog.? Thanks

  • 0
Posted

If Statements

if(strcharinfo(3) == "payon"){
	do payon stuff
}
else if(strcharinfo(3) == "prontera"){
	do prontera stuff
}
else if(strcharinfo(3) == "alberta"){
	do alberta stuff
}

IF + Switch Statements

if(strcharinfo(3) == "payon"){ set .@town,1; }
if(strcharinfo(3) == "prontera"){ set .@town,2; }
if(strcharinfo(3) == "alberta"){ set .@town,3; }

switch(.@town){
	
	case 1:
		payon here
	case 2:
		prontera here
	case 3:
		alberta here
}

Just do which ever will look cleaner and easier to follow, I'd pick the combo with switch if it was me though

That solved a lot of things for me.

Thanks.

How to switch with NPC id?

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...