Jump to content
  • 0
Sign in to follow this  
iZeal

storing npc name as variable need help

Question

Hi can anyone teach me how to store the npc name as variable so I can use it on every mes "[NPC NAME]";

and about storing messages txt into variable also i think it's same for example:

mes "Message 1";

 

I think it should be .name or .@name (.npcname) everytime i try this string the name only appears

like on npc like .name or .@name LOL couldn't find any samples though :(

 

after 2 years of long sleep on scripting i simply forgot how to do this :(.

 

I wanted to use it on a Customized Quest NPC..

 

 

Thanks in advance :D

Edited by iZeal

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

When storing string variables, you need to append them with the suffix $.

.@var = 123;.@var$ = "abc";

 

If these variables are going under an OnInit label, make sure they're permanent NPC variables instead of temporary ones.

.var = 123;.var$ = "abc";

 

These posts should help you get back into the basics of scripting:

Share this post


Link to post
Share on other sites
  • 0

@Mumbles whats the difference with the temporary ones?

 

and can you tell me how do i use them with mes ""; lines.

Share this post


Link to post
Share on other sites
  • 0

@Mumbles whats the difference with the temporary ones?

 

and can you tell me how do i use them with mes ""; lines.

 

prontera,151,189,5    script    example    100,{	mes "-------"+.npcname$+"-------";	mes "123456789abcdefgh........";	close;OnInit:	.npcname$ = strnpcinfo(1);end;}
Edited by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

btw you can just use:

 

mes "["+strnpcinfo(1)+"]";

 

so there is no need of additional variables

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.