look in my sig ull find a tut
Printable View
look in my sig ull find a tut
This is dumg, it shows the functions / methods, but doesnt show how to start / finish an npc.
How isit useful?
I tryed to make custom quest NPC from what I did understand from this tut
but it doesn't work for me, I cant click on the NPC that I edited, can u check my code, and tell me what I have to change ?
Code:/*
Made by MyLove [GM] of MyLoveStory (C)
*/
var wui = 1;
function start() {
cm.sendSimple ("hello im #bTommy#, And Im MyLoveStory GM event holder.\r\nTalk to me when you finish the Event to get your reward. \r\n#L0##bWhat is this event ?!#k #l\r\n#L1##bHmm, Ok i will start the event.#k #l\r\n#L2##bCan I have my reward?#k #l\r\n#L3##bNothing.#k #l ");
}
function action(mode, type, selection) {
cm.dispose();
if (selection == 0) {
cm.sendPrev("This is an custom GM event event for MyLoveStory, All what you got to do is \r\ncollecting 200 #i[4031095]# and then talking to me to get your reward");
cm.dispose();
} else if (selection == 1) {
cm.sendPrev("OK, Good luck");
cm.dispose();
} else if (selection == 2) {
cm.sendYesNo("So, I think you got the item, Do you want yo get your reward ?");
} else if
cm.haveItem(4031095, 200);
if cm.gainItem(4031095, -200);
cm.gainMeso(50000000);
cm.gainItem(1702119, 1):
cm.warp(100000000);
cm.dispose();
} else if (selection == 3) {
cm.sendOk("Dont waste my TIME");
cm.dispose();
}
This should work.. And why the hell is so many people using wui = 1? zzPHP Code:/****************************************
Done by bendanx3
*****************************************/
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 && status == 0) {
cm.dispose();
return;
} else if (mode == 1) {
status++;
} else {
status--;
} if (status == 0) {
cm.sendSimple ("hello im #bTommy#, And Im MyLoveStory GM event holder.\r\nTalk to me when you finish the Event to get your reward. \r\n#L0##bWhat is this event ?!#k #l\r\n#L1##bHmm, Ok i will start the event.#k #l\r\n#L2##bCan I have my reward?#k #l\r\n#L3##bNothing.#k #l ");
} else if (status == 1) {
if (selection == 0) {
cm.sendOk("This is an custom GM event event for MyLoveStory, All what you got to do is \r\ncollecting 200 #i[4031095]# and then talking to me to get your reward");
cm.dispose();
} else if (selection == 1) {
cm.sendOk("OK, Good luck");
cm.dispose();
} else if (selection == 2) {
if (cm.haveItem(4031095, 200)) {
cm.sendYesNo("So, I think you got the item, Do you want yo get your reward ?");
} else {
cm.sendOk(" You do not have the item. ");
cm.dispose();
}
} else if (selection == 3) {
cm.sendOk(" Dont waste my TIME ");
cm.dispose();
}
} else if (status == 2) {
cm.gainItem(4031095, -200)[
cm.gainMeso(cm.gainMeso(50000000);
cm.gainItem(1702119, 1):
cm.warp(100000000);
cm.dispose();
}
}
}
Thanx for the help bendan, but it's still not working, This is my first NPC coding, So I think my whole code was wrong, that's why it's not working ><
Well, It's not working, because I tryed another NPC script on the NPC that I want and worked just fine.
Very nice job! This is extremely helpful. :thumbsup:
Wow, looks great! It'll really help us beginning coders with our NPCs. Thanks a bunch d(^_^)b
Now noobs are gonna go everywhere and say they can code......
This was posted like months ago, ppl find it new here coz they arent old time ragezoner's, im sure some ppl who been here a while recognize this
Lols. Whad can you expect from noobs? Sera starterpack! :D lol .
Sorry didnt check it ytd.. in a rush.PHP Code:
/****************************************
Done by bendanx3
*****************************************/
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 && status == 0) {
cm.dispose();
return;
} else if (mode == 1) {
status++;
} else {
status--;
} if (status == 0) {
cm.sendSimple ("hello im #bTommy#, And Im MyLoveStory GM event holder.\r\nTalk to me when you finish the Event to get your reward. \r\n#L0##bWhat is this event ?!#k#l \r\n#L1##bHmm, Ok i will start the event.#k#l\r\n#L2##bCan I have my reward?#k#l\r\n#L3##bNothing.#k#l ");
} else if (status == 1) {
if (selection == 0) {
cm.sendOk("This is an custom GM event event for MyLoveStory, All what you got to do is \r\ncollect 200 Box of Parts 1 and then talking to me to get your reward");
cm.dispose();
} else if (selection == 1) {
cm.sendOk("OK, Good luck");
cm.dispose();
} else if (selection == 2) {
if (cm.haveItem(4031095, 200)) {
cm.sendYesNo("So, I think you got the item, Do you want yo get your reward ?");
} else {
cm.sendOk(" You do not have the item. ");
cm.dispose();
}
} else if (selection == 3) {
cm.sendOk(" Dont waste my TIME ");
cm.dispose();
} else if (status == 2) {
cm.gainItem(4031095, -200);
cm.gainMeso(50000000);
cm.gainItem(1702119, 1);
cm.warp(100000000);
cm.dispose();
}
}
}
}
Thanx for that. with this i'm able to use the npc and the 1,2 and 4th selction, but nothing happen when I choose the Can I have My reward selection.
You dont have to fix this, I'm thankful for what you did already, you helped me a lot, I'll try to find other scripts and see what's wrong with this one.
Nvm, i'm bored ._.
Here it works now .PHP Code:/****************************************
Done by bendanx3
*****************************************/
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 && status == 0) {
cm.dispose();
return;
} else if (mode == 1) {
status++;
} else {
status--;
} if (status == 0) {
cm.sendSimple ("hello im #bTommy#, And Im MyLoveStory GM event holder.\r\nTalk to me when you finish the Event to get your reward. \r\n#L0##bWhat is this event ?!#k#l \r\n#L1##bHmm, Ok i will start the event.#k#l\r\n#L2##bCan I have my reward?#k#l\r\n#L3##bNothing.#k#l ");
} else if (status == 1) {
if (selection == 0) {
cm.sendOk("This is an custom GM event event for MyLoveStory, All what you got to do is \r\ncollect 200 Box of Parts 1 and then talking to me to get your reward");
cm.dispose();
} else if (selection == 1) {
cm.sendOk("OK, Good luck");
cm.dispose();
} else if (selection == 2) {
if (cm.haveItem(4031095, 200)) {
cm.sendYesNo("So, I think you got the item, Do you want yo get your reward ?");
} else {
cm.sendOk(" You do not have the item. ");
cm.dispose();
}
} else if (selection == 3) {
cm.sendOk(" Dont waste my TIME ");
cm.dispose();
}
} else if (status == 2) {
cm.gainItem(4031095, -200);
cm.gainMeso(50000000);
cm.gainItem(1702119, 1);
cm.warp(100000000);
cm.dispose();
}
}
}
Thanx a lot for the help.
Why dont any one make a theard and esplain the important java codes like the
if and else if
and the var status and things ? and yea maybe the &&
and some base methods.
Jus wondring, because that would realy help new people that trying to learn how to code. like me :P