This is a great tut ty so much
Printable View
This is a great tut ty so much
What about if you want to let someone die, is there a command for that, and something to decrease HP? I tried to look up Roger's script (Beginner world, youknow, the guy from "The Apple"!) but it wasn't in my repack O_O And for so far I know there aren't any other NPC's who decrease HP or actually KILL players.
So do you know these commands?
(I'm sorry if this could be found anywhere I was in a rush and my tried searches resulted in nothing!)
lol nice guide and i finally understand on how to do this but how lets say u want to give someone more than one item should it look like
cm.gainItem(2000005,2000006); might not be an actuall item but i jsut want to know im trying to make a custom mount npc
dude! thsi is an awesome tutorial!
this should be made sticky!
i really learned alot here.
i might even make some releases :P
---------- Post added at 10:41 PM ---------- Previous post was at 10:36 PM ----------
actually,
if you wanna have more than one item
if its quantity then its suppose to be cm.gainItem(itemid, quantity);
if its different items
cm.gainItem(itemid, 1 or different quantity)
cm.gainItem(itemid, 1 or different quantity);
after the first cm.gainItem(itemid, 1 or different quantity)
there must be a ;
for some reason.
i have no idea why.
please correct me if im wrong!
example :
cm.gainItem(1002820, 1)
cm.gainItem(1012006, 1);
cm.gainItem(2000005, 300);
cm.gainItem(2022121, 15);
cm.gainItem(2022123, 15);
cm.gainItem(1702153, 1);
cm.gainItem(1040129, 1);
cm.gainItem(1062081, 1);
cm.gainItem(1102142, 1);
cm.gainItem(1102146, 1);
cm.gainItem(1082162, 1);
cm.gainItem(1072325, 1);
cm.gainItem(1302024, 1);
cm.gainItem(1092035, 1);
cm.gainItem(1050018, 1);
cm.gainItem(1051017, 1);
cm.gainItem(5010030, 1);
cm.gainItem(5072000, 10);
cm.gainItem(5000031, 1);
cm.gainItem(50000*** 1);
cm.gainItem(5000033, 1);
cm.gainItem(2120000, 500);
cm.gainItem(5390000, 5);
thats what i did and my npc doesn't work lol anyone know what do do?? or can tell me what im doing wrong??
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("Goodbye, oh ya thanks for saying thank you hidden for making this and taking up an hour of time u were apost to be doing ur homework :)");
cm.dispose();
return;
}
if (mode == 1) {
status++;
}
else {
status--;
}
if (status == 0) {
cm.sendNext("Hello there im hiddens fisrt custom npc!");
}
else if (status == 1) {
cm.sendSimple("You have custom mounts.\r\n#L0#Can I have some more please?#l\r\n#L1#Nah, I don't want any.#l");
}
else {
cm.sendOk("You don't have custom mounts? Here I'll give you some make sure u have 45 open slots ass.!");
cm.gainItem(01902015,1);
cm.gainItem(01902016,1);
cm.gainItem(01902017,1);
cm.gainItem(01902018,1);
cm.gainItem(01902022,1);
cm.gainItem(01902023,1);
cm.gainItem(01902024,1);
cm.gainItem(01902025,1);
cm.gainItem(01912011,1);
cm.gainItem(01912015,1);
cm.gainItem(01912016,1);
cm.gainItem(01912017,1);
cm.gainItem(01912018,1);
cm.gainItem(01902014,1);
cm.gainItem(01902015,1);
cm.gainItem(01902016,1);
cm.gainItem(01902017,1);
cm.gainItem(01902025,1);
cm.gainItem(01902025,1);
cm.gainItem(01912010,1);
cm.gainItem(01912011,1);
cm.gainItem(01912012,1);
cm.gainItem(01912013,1);
cm.gainItem(01912014,1);
cm.gainItem(01912015,1);
cm.gainItem(01912016,1);
cm.gainItem(01912017,1);
cm.gainItem(01912018,1);
cm.gainItem(01902026,1);
cm.gainItem(01902027,1);
cm.gainItem(01902031,1);
cm.gainItem(019020***1);
cm.gainItem(01902033,1);
cm.gainItem(01902034,1);
cm.gainItem(01902035,1);
cm.gainItem(01902037,1);
cm.gainItem(01912019,1);
cm.gainItem(01912021,1);
cm.gainItem(01912024,1);
cm.gainItem(01912025,1);
cm.gainItem(01912026,1);
cm.gainItem(01912027,1);
cm.gainItem(01912028,1);
cm.gainItem(01912030,1);
cm.dispose();
}
}
else if (status == 2) {
if (selection == 0) {
cm.sendOk("Okay here you go make sure u have 45 open spots in your inventory");
ccm.gainItem(01902015,1);
cm.gainItem(01902016,1);
cm.gainItem(01902017,1);
cm.gainItem(01902018,1);
cm.gainItem(01902022,1);
cm.gainItem(01902023,1);
cm.gainItem(01902024,1);
cm.gainItem(01902025,1);
cm.gainItem(01912011,1);
cm.gainItem(01912015,1);
cm.gainItem(01912016,1);
cm.gainItem(01912017,1);
cm.gainItem(01912018,1);
cm.gainItem(01902014,1);
cm.gainItem(01902015,1);
cm.gainItem(01902016,1);
cm.gainItem(01902017,1);
cm.gainItem(01902025,1);
cm.gainItem(01902025,1);
cm.gainItem(01912010,1);
cm.gainItem(01912011,1);
cm.gainItem(01912012,1);
cm.gainItem(01912013,1);
cm.gainItem(01912014,1);
cm.gainItem(01912015,1);
cm.gainItem(01912016,1);
cm.gainItem(01912017,1);
cm.gainItem(01912018,1);
cm.gainItem(01902026,1);
cm.gainItem(01902027,1);
cm.gainItem(01902031,1);
cm.gainItem(019020***1);
cm.gainItem(01902033,1);
cm.gainItem(01902034,1);
cm.gainItem(01902035,1);
cm.gainItem(01902037,1);
cm.gainItem(01912019,1);
cm.gainItem(01912021,1);
cm.gainItem(01912024,1);
cm.gainItem(01912025,1);
cm.gainItem(01912026,1);
cm.gainItem(01912027,1);
cm.gainItem(01912028,1);
cm.gainItem(01912030,1);
cm.dispose();
}
else if (selection == 1) {
cm.sendOk("Thanks for thanking hidden for taking up an hour of his time meanie");
cm.dispose();
}
}
}
}
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("Goodbye, oh ya thanks for saying thank you hidden for making this and taking up an hour of time u were apost to be doing ur homework :)");
cm.dispose();
return;
}
if (mode == 1) {
status++;
}
else {
status--;
}
if (status == 0) {
cm.sendNext("Hello there im hiddens fisrt custom npc!");
}
else if (status == 1) {
cm.sendSimple("You have custom mounts.\r\n#L0#Can I have some more please?#l\r\n#L1#Nah, I don't want any.#l");
}
else {
cm.sendOk("You don't have custom mounts? Here I'll give you some make sure u have 45 open slots ass.!");
function action(mode, type, selection) {
cm.dispose();
if (selection == 0) {
cm.gainItem(01902015,1);
cm.gainItem(01902016,1);
cm.gainItem(01902017,1);
cm.gainItem(01902018,1);
cm.gainItem(01902022,1);
cm.gainItem(01902023,1);
cm.gainItem(01902024,1);
cm.gainItem(01902025,1);
cm.gainItem(01912011,1);
cm.gainItem(01912015,1);
cm.gainItem(01912016,1);
cm.gainItem(01912017,1);
cm.gainItem(01912018,1);
cm.gainItem(01902014,1);
cm.gainItem(01902015,1);
cm.gainItem(01902016,1);
cm.gainItem(01902017,1);
cm.gainItem(01902025,1);
cm.gainItem(01902025,1);
cm.gainItem(01912010,1);
cm.gainItem(01912011,1);
cm.gainItem(01912012,1);
cm.gainItem(01912013,1);
cm.gainItem(01912014,1);
cm.gainItem(01912015,1);
cm.gainItem(01912016,1);
cm.gainItem(01912017,1);
cm.gainItem(01912018,1);
cm.gainItem(01902026,1);
cm.gainItem(01902027,1);
cm.gainItem(01902031,1);
cm.gainItem(019020***1);
cm.gainItem(01902033,1);
cm.gainItem(01902034,1);
cm.gainItem(01902035,1);
cm.gainItem(01902037,1);
cm.gainItem(01912019,1);
cm.gainItem(01912021,1);
cm.gainItem(01912024,1);
cm.gainItem(01912025,1);
cm.gainItem(01912026,1);
cm.gainItem(01912027,1);
cm.gainItem(01912028,1);
cm.gainItem(01912030,1);
cm.dispose();
}
}
else if (status == 2) {
if (selection == 0) {
cm.sendOk("Okay here you go make sure u have 45 open spots in your inventory");
function action(mode, type, selection) {
cm.dispose();
if (selection == 0) {
ccm.gainItem(01902015,1);
cm.gainItem(01902016,1);
cm.gainItem(01902017,1);
cm.gainItem(01902018,1);
cm.gainItem(01902022,1);
cm.gainItem(01902023,1);
cm.gainItem(01902024,1);
cm.gainItem(01902025,1);
cm.gainItem(01912011,1);
cm.gainItem(01912015,1);
cm.gainItem(01912016,1);
cm.gainItem(01912017,1);
cm.gainItem(01912018,1);
cm.gainItem(01902014,1);
cm.gainItem(01902015,1);
cm.gainItem(01902016,1);
cm.gainItem(01902017,1);
cm.gainItem(01902025,1);
cm.gainItem(01902025,1);
cm.gainItem(01912010,1);
cm.gainItem(01912011,1);
cm.gainItem(01912012,1);
cm.gainItem(01912013,1);
cm.gainItem(01912014,1);
cm.gainItem(01912015,1);
cm.gainItem(01912016,1);
cm.gainItem(01912017,1);
cm.gainItem(01912018,1);
cm.gainItem(01902026,1);
cm.gainItem(01902027,1);
cm.gainItem(01902031,1);
cm.gainItem(019020***1);
cm.gainItem(01902033,1);
cm.gainItem(01902034,1);
cm.gainItem(01902035,1);
cm.gainItem(01902037,1);
cm.gainItem(01912019,1);
cm.gainItem(01912021,1);
cm.gainItem(01912024,1);
cm.gainItem(01912025,1);
cm.gainItem(01912026,1);
cm.gainItem(01912027,1);
cm.gainItem(01912028,1);
cm.gainItem(01912030,1);
cm.dispose();
}
}
else if (selection == 1) {
cm.sendOk("Thanks for thanking hidden for taking up an hour of his time meanie");
cm.dispose();
}
}
}
}
---------- Post added at 11:31 AM ---------- Previous post was at 11:26 AM ----------
not sure if that works.
I can't really figure out what's wrong with this one! :sleep:Code:/*
** NPC: Cesar (2101017)
** Map: Maple Road (ID:20000)
*/
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("Goodbye");
cm.dispose();
return;
}
if (mode == 1) {
status++;
}
else {
status--;
}
if (status == 0) {
if(cm.haveItem(4001027)) {
cm.sendNext("Cesar checks for medal.");
}
if(cm.haveItem(4001029)) {
cm.sendOk("Cesar takes food! Cesar gives scroll!");
cm.gainItem(4001029,-1);
cm.gainItem(4001028,1);
cm.dispose();
}
else {
cm.sendOk("Cesar gives stone!");
cm.gainItem(4001035,1);
cm.dispose();
}
}
else if (status == 1) {
cm.warp(30000,0);
cm.dispose();
}
}
}
I'm sorry to bother anyone with this! Brackets are fine! (12 }'s and 12 {'s)
It would be nice if anyone could find an answer for this one!
cool, thanks, can u make it dor downloads? .rar/.zip?
Wow, thanks for keeping this guide alive guys. I can't believe many people still read and thank this guide.
@Gnomedrago
I know it's too late to fix your script for you, but I'm just going to say so the answer is on the same page as your question if anyone comes to see it.
The 2nd if(cm.haveItem()) needs to be
else if(cm.haveItem())
I come and check to see if this thread is still alive every now and then. I makes me happy it helps so many people. Thanks everyone!
I don't understand what the mode means.
Like in here,
Code:if (mode == -1) {
This is cody script ,Quote:
/* Cody
*/
importPackage(net.sf.odinms.client);
var status = 0;
var job;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendOK("Hello. I'm Cody. Nice to meet you! =)");
cm.dispose();
return;
}
}
}
when i replace with another script .
It won't update to my new script .(v75 arberms)
Last time i host using v62 , it will always auto update the scripts even the server is running .
How to solve it ? ty :O:
Something is wrong in my script oO The selection 0 part doesn't work the other part does help xD?
Code:var status = 0;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == 1) {
status++;
}else{
status--;
}
if (status == 0) {
cm.sendSimple("Hey there. would you like to \r\n#L0# Trade 1 billion mesos for a tetris piece#l \r\n or \r\n #L1#Trade a tetris piece for 1 billion mesos#l");
}else if (status == 1){
if (selection == 0) {
if (cm.getMesos() >= 1000000000){
cm.sendOk("Congratz! succesfull trade!");
cm.gainItem(4030002, 1);
cm.gainMesos(-1000000000);
cm.dispose();
}else{
cm.sendOk("You don't have enough mesos! Go hunt more :D");
cm.dispose();
}
}else if (selection == 1) {
if (cm.haveItem(4030002) >= 1) {
cm.sendOk("Congratz! succesfull trade!");
cm.gainItem(4030002, -1);
cm.gainMesos(1000000000);
cm.dispose();
}else{
cm.sendOk("You dont have a tetris piece! Go hunt mesos :D");
cm.dispose();
}
}
}
}
HEY! i am new here :3 and new to making a sever.. and i folowed you giude. it is good.. but.. i created v55 and when i click my npc, it is not opening anything.... i did a super rebirth with your guides.. can you edit it for me?
link : http://www.mediafire.com/?tm5xjgmj0z0
:http://www.filefront.com/16581077/9010004.rar