
Originally Posted by
Garvorious
Can you check out my code, I got a few errors.
Code:
// Created by Garvorious
// NPC: The Perma-Noob Teleporter
var status = 0;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
}
else {
if (status >= 2 && mode == 0) {
cm.sendOk("All right, enjoy iStory!");
cm.dispose();
return;
}
if (mode == 1) {
status++;
}
else {
status--;
}
if (status == 0) {
cm.sendNext("Hey! Welcome to iStory. I'm Garv's bitch here to help you out.");
}
else if (status == 1) {
cm.sendSimple("Since the magic bush teleports users, Im here to tele you. Sorry for the confusion");
}
else {
cm.sendOk("Where do you want to go? \r\n#L0I want to go to Victoria Island!#l\r\n#L1#I want to be a Perma-Noob.#l");
}
else if (status == 2) {
if (selection == 0) {
cm.sendOk("Allright, have fun in Victoria Island!);
cm.warp(100000000, 0);
cm.dispose();
}
else if (selection == 1) {
cm.sendOk("Okay, have fun being a noob!");
cm.warp(1010000, 0) {
cm.dispose();
}
}
}
Sorry for the close spaceing, the copy paste didnt copy all of it.
Here's the acual .js:
http://www.mediafire.com/?xddrxiodm2d
PHP Code:
var status = -1; //Why puting the value of 0 here, and -1 ni start function? it's a waste of time.
function start() {
cm.sendNext("Hey! Welcome to iStory. I'm Garv's bitch here to help you out."); //In this case, this can basically remplace the action(1,0,0) since the user will make the value at next.
}
function action(mode, type, selection) {
status++; //status will never get status--, so, why bother to add it?
if (mode == -1) { //Reduce all the shit, because the one you used it obvious a copy paste from another one, plus, it will never be mode == 0 unless you press Exit Chat in sendSimple, but since it said "&& status >= 2", then it will NEVER research that point.
cm.dispose();
return;
}
if (status == 0) //Removed brackets because It's only 1 line of procedure, you cna leave the brackets, I just like it without brackets.
cm.sendSimple("Since the magic bush teleports users, Im here to tele you. Sorry for the confusion\r\n #L0#Continue talking slut"); //ou forgot to add a option. Or not use sendSimple here.
else if(status == 1) //You don't put "else" to choose a option. Also I removed brackets again.
cm.sendSimple("Where do you want to go? \r\n#L0#I want to go to Victoria Island!#l\r\n#L1#I want to be a Perma-Noob.#l"); //You forgot a # after #L0, Also, this should be sendSimple
else if (status == 2) {
cm.sendOk(selection == 0 ? "Allright, have fun in Victoria Island!" : "Okay, have fun being a noob!"); //You missed a " in the victoria one, Also I make it shorten.
cm.warp(selection == 0 ? 100000000 : 1010000); //Why defining the spawn point if it's 0? lets just use the 1 parameter one. ALso, I make it shorten too.
cm.dispose(); //1 dispose at the end with you way of do this would be better, since boths will research this part anyhow.
}
}
Thought you where dev.