Here's a working version:
Study it so you won't make the same mistakes twice.
PHP Code:
epenis = -1;
nubs = [1512, 2112, 1412, 1312, 1212, 1112, 512, 522, 421, 422, 412, 322, 232, 222, 212, 132, 122, 112];
function start() { // this isn't too bad. It functions the way it should.
if (cm.getPlayer().getReborns() >= 40) //You can just as well use the brackets. It's more organized and clearer.
cm.sendYesNo("Ohh! A whopping #b40 Rebirths#k!!! Would you like to select your Job. ");
else {
var diff = 40 - cm.getPlayer().getReborns();
cm.sendOk("I offer Jobs to people with #b40+ Reborns#k. Come and see me when you have "+ diff +" more reborns!");
cm.dispose();
}
}
function action(mwhaha,troll,job){
if (mwhaha == 1) {
epenis++;
}
if (epenis == 0) {
cm.sendSimple("What job would you like to have?\r\n\
#L1#ThunderBreaker\r\n\
#L2#Aran\r\n\
#L3#NightWalker\r\n\
#L4#WindArcher\r\n\
#L5#BlazeWizard\r\n\
#L6#DawnWarrior\r\n\
#L7#Buccaneer\r\n\
#L8#Corsair\r\n\
#L9#ChiefBandit\r\n\
#L10#Shadower\r\n\
#L11#NightLord\r\n\
#L12#CrossBowmaster\r\n\
#L13#Bishop\r\n\
#L14#IL_ArchMage\r\n\
#L15#FP_ArchMage\r\n\
#L16#DarkNight\r\n\
#L17#Paladin\r\n\
#L18#Hero"); // keep it organized. It's way easier to read like this.
} else if (epenis == 1) {
cm.changeJobById(nubs[job++]);
cm.sendOk("Enjoy your new Job.");
}
cm.dispose();
}
Here's my comments on your version:
Read it, learn it read it again and make sure you never forget.
PHP Code:
//Should have used status in this NPC but you didn't.
function start() { // as I said, nothing wrong with this.
if(cm.getPlayer().getReborns() >= 40) // Could have still used the brackets here. It's more organized and it looks cleaner.
cm.sendYesNo("Ohh! A whopping #b40 Rebirths#k!!! Would you like to select your Job. ");
else {
var diff = 40 - cm.getPlayer().getReborns();
cm.sendOk("I offer Jobs to people with #b40+ Reborns#k. Come and see me when you have "+ diff +" more reborns!");
cm.dispose();
}
}
function action(m,t,s){
if(m > 0){ // this doesn't make any sense. Also the closing brackets should be on a new line and preferebly each option too. You should increase status here, not display text.
cm.sendSimple("What job would you like to have?\r\n\#L1#ThunderBreaker\r\n\#L2#Aran\r\n\#L3#NightWalker\r\n\#L4#WindArcher\r\n\#L5#BlazeWizard\r\n\#L6#DawnWarrior\r\n\#L7#Buccaneer\r\n\#L8#Corsair\r\n\#L9#ChiefBandit\r\n\#L10#Shadower\r\n\#L11#NightLord\r\n\#L12#CrossBowmaster\r\n\#L13#Bishop\r\n\#L14#IL_ArchMage\r\n\#L15#FP_ArchMage\r\n\#L16#DarkNight\r\n\#L17#Paladin\r\n\#L18#Hero");}
// closing bracket should be here, not on the previous line.
// new status should be here.
}else if (selcetion == 1){ //start off with if (selection == 1). Also, spelling mistake. selcetion != selection. Plus, it should be 's', not selection or selcetion
cm.changeJobById(1512); //could have used an array here to shorten your script
sendOk("Enjoy your new Job."); //forgot cm. in cm.sendOk("blabla");
cm.dispose(); // You can do one general cm.dispose(); on the bottom of this particular NPC script. It depends on each NPC though if it's possible.
} // one bracket too much
}else if (selcetion == 2){ // idem for this one and all statements below
cm.changeJobById(2112);
sendOk("Enjoy your new Job.");
cm.dispose();
} //bracket too much
}else if (selcetion == 3){
cm.changeJobById(1412);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 4){
cm.changeJobById(1312);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 5){
cm.changeJobById(1212);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 6){
cm.changeJobById(1112);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 7){
cm.changeJobById(512);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 8){
cm.changeJobById(522);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 9){
cm.changeJobById(421);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 10){
cm.changeJobById(422);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 11){
cm.changeJobById(412);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 12){
cm.changeJobById(322);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 13){
cm.changeJobById(232);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 14){
cm.changeJobById(222);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 15){
cm.changeJobById(212);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 16){
cm.changeJobById(132);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 17){
cm.changeJobById(122);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
}else if (selcetion == 18){
cm.changeJobById(112);
sendOk("Enjoy your new Job.");
cm.dispose();
}//bracket too much
} //You put way too many brackets so these don't make sense
} // ^