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

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

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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