I feel embarrassed asking why this doesn't work, but i need to learn. Its very simple script and shouldnt be giving me errors but for some reason, whenever it gets to the line cm.openNpc(9200000); it D/c's me and says in the log Send NPC_CHAT, thats a packet error isnt it? Does the openNpc function need to be in a seperate status? I also tried this script with a selection, says like choose your path. Then it would go and open the npc with a selection in status 1 instead of just directly doing it after hitting next. I know the scripts probably poorly written and executing not well but it works untill the point of opening the other npc..
heres the script see what you can do guys!
PHP Code:var status = -1;
var nationcoin = 999999; //filler
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == 0 || mode == -1 && status == 0) {
cm.dispose();
return;
} else
(mode == 1 ? status++ : status--);
if (status == 0) {
if (cm.getPlayer().getJob() == 0){
cm.sendSimple("Greetings great hero, welcome to the server. I will be your mentor and I am here to help you begin your adventure. Please continue and choose yourself a path. Then talk to me again!");
}else{
cm.sendOk("I have a task for you now, please perform it and I will send you on your way! Bring me 30 Nation coins, from the uglies in the other room. They steal them all the time!");
cm.dispose();
}
}else if (status == 1){
cm.dispose();
cm.openNpc(9900002);
if (cm.getPlayer().haveItem(nationcoin, 30)){
cm.sendSimple("Great, for your help I will take you to where you can begin your adventure and reward you with 3 of these special coins, hold on to them they'll come in handy.");
cm.warp(910000000);
cm.gainItem(nationcoin, -100000);
cm.gainItem(nationcoin, 3);
cm.dispose();
}else{
cm.sendOk("Please get me those coins sir!");
cm.dispose();
}
}
}

