- Joined
- Nov 26, 2012
- Messages
- 156
- Reaction score
- 35
Hi,
So i'm making an NPC so that when a selection is clicked "Buy a fishing chair"
It dc's me to login screen saying "An error occured while trying to connect to the server"
My script is
So the error is occuring from:
But i don't see whats wrong with this?
Thanks
So i'm making an NPC so that when a selection is clicked "Buy a fishing chair"
It dc's me to login screen saying "An error occured while trying to connect to the server"
My script is
PHP:
importPackage(Packages.tools);
var status = 0;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
}else if (mode == 0){
cm.sendOk ("#eOkay!");
cm.dispose();
}else{
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendNext("Hey! I am the Incharge of the Fishing System and the Fishing Lagoon!");
}else if (status == 1) {
cm.sendSimple ("What do you want me to do?#e#d" +
"#k\r\n#L0##b Tell me the information about the Fishing System" +
"#k\r\n#L1##b How to fish?" +
"#k\r\n#L4##b I want to enter the fishing Lagoon!" +
"#k\r\n#L3##b Buy a fishing chair" +
"#k\r\n\r\n#L2##g Episode Quest");
} else if (selection == 0) {
cm.sendOk("#eIntroduction#n\r\nFishing System in MS is quite similar to MapleSEA but not MapleGlobal. In the fishing system, you can gain EXP and MESO! It can also be called the Slack training system. At the same time, you can also get Fishing EXP to Level up your Fishing Level.\r\n\r\n#eFishing Lagoon Population#n\r\nThere are currently " + cm.getPlayersInMap(970020001) +" player(s) in Fishing Lagoon. The Fishing Lagoon can take up to 25Players per channel.\r\n\r\n#eBuy a Fishing Chair#n\r\nYou need to have at least 5 rebirths and 20Plastic Crowns to buy the Fishing Chair.You may not be able to buy more than 1 fishing chair.\r\n\r\n#eFishing EXP and Fishing Level#n\r\nYou will gain random amount of Fishing EXP when you are sitting in this map with fishing chair. When you gain your fishing exp, there will be special effect on you and notice will appear. Once you reaches the amount you need for your level, you will level up your Fishing Level. With your Fishing level, you can use it to buy items needed for any other custom features in MS\r\n\r\n#eThe Fishing Interval#n\r\nOnce you are sit in your Fishing chair in this map, you will be able to gain EXP,MESO,Fishing EXP at some random amount every 30sec.You will be gaining either MESO or EXP or even none. Once your meso reaches 2.1billion, you will no longer gain anymore MESO! So make sure that you remember to buy crowns!\r\n\r\n#eFishing EXP Table#n\r\nLevel1 - 60\r\nLevel2 - 90\r\nLevel3 - 130\r\nLevel4 - 180\r\nLevel5 - 240\r\nLevel6 - 310\r\nLevel7 - 390\r\nLevel8 - 480\r\nLevel9 - 580\r\nLevel10 - 690\r\nLevel11 - 710\r\nLevel12 - 840\r\nLevel13 - 980\r\nLevel14 - 1130\r\nLevel15 - 1337\r\nThe rest of the amount of EXP Needed for the level above 15 will be secret :P I Dont wanna tell you~ Lalala");
cm.dispose();
} else if (selection == 1) {
cm.sendOk("First, you must have a Fishing Chair with you.\r\n Once you have checked that you have a fishing chair, you would have to come to the Fishing Lagoon to start fishing! Then, you can sit at any place you want with your fishing chair and you will start to fish. You will get random amount of EXP or MESO every 30seconds and also Fishing EXP. For more information about Fishing EXP and Level, please end this chat and talk to me again and press the first line. Once you think that you want to stop, you can stand up from the chair and exit this map. YOU WILL NOT GAIN ANY EXP,MESO OR FISHING EXP IF YOU ARE NOT SITTING AT YOUR FISHING CHAIR!");
cm.dispose();
} else if (selection == 2) {
if(cm.getPlayer().getESP() == 1) {
cm.sendOk("Oh! Yes i forget to tell Chef that there's no stock. For some reason, there's no fish in the sea. Can you do me a favour?\r\n\r\nGo down to aqua and hunt #e500Seal meat#n and pass it to #rChef#k.");
cm.gainESP(1);
cm.dispose();
} else if(cm.getPlayer().getESP() == 3) {
cm.sendOk("Remember i told you that there's no fish in the sea?\r\nIt already had been like this for 1and a half month! And also all my net have suddenly went missing!\r\n\r\nCan you help me make a #ePolice#n report? Thankyou");
cm.gainESP(1);
cm.dispose();
} else if(cm.getPlayer().getESP() == 8) {
cm.sendOk("Huh? Policeman want you to ask me question?\r\nSure!\r\nWell basically I went for vacation 1 and a half month ago and when i came back all the fish in the sea is gone!\r\nJust recently, infact last week, all my net have been stolen! I saw no one entering my lagoon during that time!\r\n\r\n I think that the case will take some time. Will you help me tell #echef#n that i wont be selling him seafood for a few days or week.");
cm.gainESP(1);
cm.dispose();
} else {
cm.sendOk ("Your not needed for episode.\r\nYou can refer to the Hotel Manager about the Story Mode Episodes.");
cm.dispose();
}
} else if (selection == 3) {
cm.sendNext("Would you like to buy a fishing chair? You will need 10 plastic crowns!");
if(cm.haveItem(4000100, 10)) {
cm.gainItem(4000100, -10);
cm.gainItem(3011000, 1);
cm.sendOk ("You have purchased a fishing chair");
cm.dispose();
} else {
cm.sendOk ("You need to have 10 plastic crowns to make this item.");
cm.dispose();
}
} else if (selection == 4) {
if (cm.getPlayersInMap(970020001) < 26 && cm.haveItem(3011000, 1) && cm.getPlayer().getReborns() > 4) {
cm.warp(970020001);
cm.mapMessage(5, "" + cm.getPlayer().getName() + " have enter the Fishing Lagoon.");
cm.playerMessage(1, "Enjoy fishing!");
cm.dispose();
} else {
cm.sendOk("Sorry, you may not enter the Fishing Lagoon because of any of the following reason:\r\n You do not have at least 5rebirth\r\n You do not have a Fishing Chair \r\n There are more than 25Players in the Lagoon.");
cm.dispose();
}
}
}
}
So the error is occuring from:
PHP:
} else if (selection == 3) {
cm.sendNext("Would you like to buy a fishing chair? You will need 10 plastic crowns!");
if(cm.haveItem(4000100, 10)) {
cm.gainItem(4000100, -10);
cm.gainItem(3011000, 1);
cm.sendOk ("You have purchased a fishing chair");
cm.dispose();
} else {
cm.sendOk ("You need to have 10 plastic crowns to make this item.");
cm.dispose();
}
But i don't see whats wrong with this?
Thanks