[SOLVED] Need help making NPC that non-clickable

Started by namerpus18, Nov 25, 2022, 06:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

namerpus18

Hello everyone it's me again - the noob :)
I have this NPC that I want to make non-clickable. Instead, I want it to be triggered if a player comes 1cell near this NPC. I tried to make it npcID# "-1903" but it became invisible /wah. But it is working the way I want it, but the only problem is it is invisible :P I want to be a visible NPC.
I know this will be helpful to me someday so I am experimenting with it so I know when the time comes that I will need it.
As always, thank you so much for the help  /lv

prontera,147,173,4 script Chest#01 1903,1,1,{
mes "Opening chest in";
sleep2 1000;
mes "5...";
sleep2 1000;
mes "4...";
sleep2 1000;
mes "3...";
sleep2 1000;
mes "2...";
sleep2 1000;
mes "1...";
sleep2 1000;
        //extra script here to obtain the item from the chest
mes "Loot obtained.";
close;
}

Insomnia2000

Just add an "end;" at the very beginning and an "OnTouch:" label shortly after like so. You'll still end up with the "..." cursor, but clicking on the NPC will do nothing.


prontera,147,173,4 script Chest#01 1903,1,1,{

end;

OnTouch:
mes "Opening chest in";
sleep2 1000;
mes "5...";
sleep2 1000;
mes "4...";
sleep2 1000;
mes "3...";
sleep2 1000;
mes "2...";
sleep2 1000;
mes "1...";
sleep2 1000;
        //extra script here to obtain the item from the chest
mes "Loot obtained.";
close;
}

namerpus18

Quote from: Insomnia2000 on Nov 25, 2022, 08:01 AM
Just add an "end;" at the very beginning and an "OnTouch:" label shortly after like so. You'll still end up with the "..." cursor, but clicking on the NPC will do nothing.


prontera,147,173,4 script Chest#01 1903,1,1,{

end;

OnTouch:
mes "Opening chest in";
sleep2 1000;
mes "5...";
sleep2 1000;
mes "4...";
sleep2 1000;
mes "3...";
sleep2 1000;
mes "2...";
sleep2 1000;
mes "1...";
sleep2 1000;
        //extra script here to obtain the item from the chest
mes "Loot obtained.";
close;
}


WOW! It worked.   /lv
Thank you so much