iZeal 5 Posted July 28, 2014 (edited) 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 Edited July 28, 2014 by iZeal Quote Share this post Link to post Share on other sites
0 Mumbles 193 Posted July 28, 2014 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: Crash Course: Scripting 101-A Crash Course: Scripting 101-B 1 iZeal reacted to this Quote Share this post Link to post Share on other sites
0 iZeal 5 Posted July 28, 2014 @Mumbles whats the difference with the temporary ones? and can you tell me how do i use them with mes ""; lines. Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted July 28, 2014 (edited) @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 July 28, 2014 by Angelmelody 1 iZeal reacted to this Quote Share this post Link to post Share on other sites
0 iZeal 5 Posted July 28, 2014 now that was missing "" Thank you @Angel Quote Share this post Link to post Share on other sites
0 evilpuncker 503 Posted July 28, 2014 btw you can just use: mes "["+strnpcinfo(1)+"]"; so there is no need of additional variables 1 iZeal reacted to this Quote Share this post Link to post Share on other sites
0 iZeal 5 Posted July 28, 2014 I'll try that also Quote Share this post Link to post Share on other sites
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
Edited by iZealShare this post
Link to post
Share on other sites