help || npc edit

Newbie Spellweaver
Joined
Nov 1, 2012
Messages
10
Reaction score
0
what is the problem it meant to take 10 items from your inv and warp you
help plz

PHP:
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.dispose();    
            return;    
        }    
           
        if (mode == 1) {   
            status++;   
        }       
        else {   
            status--;   
        }   
           
        if (status == 0) {  
            cm.sendYesNo("hey man do you have my 10? #b#v4031138##k go get them from the noob snails!"); 
        } 
        else if (status == 1) { 
            cm.gainitem(4031138,-10); 
            cm.warp(222020110,0); 
            cm.dispose(); 
        } 
    } 
}
 
Code:
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.dispose();    
            return;    
        }    
           
        if (mode == 1) {   
            status++;   
        }       
        else {   
            status--;   
        }   
           
        if (status == 0) {  
            cm.sendYesNo("hey man do you have my 10? #b#v4031138##k go get them from the noob snails!"); 
        } 
        else if (status == 1) { 
            cm.gainitem(4031138,-10); 
            cm.warp(222020110,1); 
            cm.dispose(); 
        } 
    } 
}
 
Upvote 0
also please please include this inside if cm.haveItem(4031138, 10);
then put your code in if you don't i think the npc will just take whatever the guy has of item 4031138 and then warp the player

now to fix the problem if you click no include an "else" statement like
else { if (cm.haveItem(4031138) < 10
followed by maybe a message telling them to get the item

( i know you want to close this thread by I think you should really have a cm.haveItem statement to check if the player has it )
 
Upvote 0
what is the problem it meant to take 10 items from your inv and warp you
help plz

PHP:
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.dispose();    
            return;    
        }    
           
        if (mode == 1) {   
            status++;   
        }       
        else {   
            status--;   
        }   
           
        if (status == 0) {  
            cm.sendYesNo("hey man do you have my 10? #b#v4031138##k go get them from the noob snails!"); 
        } 
        else if (status == 1) { 
            cm.gainitem(4031138,-10); 
            cm.warp(222020110,0); 
            cm.dispose(); 
        } 
    } 
}

You Script is missing so much stuff.

PHP:
function start() { 
    cm.sendNext("Hello , Welcome to ......! Hey listen if you give me #b#v4031138##k I'll give you....... How about it?."); 
} 

function action(mode, type, selection) { 
    if (mode < 1) { 
        cm.dispose(); 
        return; 
          }
    if(cm.haveItem(4031138,1)) {
	 cm.gainItem(.......,1);
     cm.gainItem(4031138,-1);
    cm.warp(910000000);
    cm.sendOk("Thank you! Press @help for the commands!");
                } else
                    cm.sendOk("Sorry, you don't have #b#v4031138##k! Come back when you do!");
                cm.dispose();
				}
[/QUOTE]

Your welcome.
 
Upvote 0
You Script is missing so much stuff.

PHP:
function start() { 
    cm.sendNext("Hello , Welcome to ......! Hey listen if you give me #b#v4031138##k I'll give you....... How about it?."); 
} 

function action(mode, type, selection) { 
    if (mode < 1) { 
        cm.dispose(); 
        return; 
          }
    if(cm.haveItem(4031138,1)) {
	 cm.gainItem(.......,1);
     cm.gainItem(4031138,-1);
    cm.warp(910000000);
    cm.sendOk("Thank you! Press @help for the commands!");
                } else
                    cm.sendOk("Sorry, you don't have #b#v4031138##k! Come back when you do!");
                cm.dispose();
				}

Your welcome.[/QUOTE]


thnx man!!! :P im new to this stuff
 
Upvote 0
function start() {
cm.sendNext("Hello , Welcome to ......! Hey listen if you give me #b#v4031138##k I'll give you.......how about it?.");
}

function action(mode, type, selection) {
if (mode < 1) {
cm.dispose();
return;
}
if(cm.haveItem(4031138,1)) {
cm.gainItem(.......,1);
cm.gainItem(4031138,-1);
cm.warp(910000000);
cm.sendOk("Thank you! Press @help for the commands!");
} else
cm.sendOk("Sorry, you don't have #b#v4031138##k! Come back when you do!");
cm.dispose();
}

[/PHP]



glad you included the cm.haveItem for him it will be bad if the npc didnt have it
 
Upvote 0
You Script is missing so much stuff.

PHP:
function start() { 
    cm.sendNext("Hello , Welcome to ......! Hey listen if you give me #b#v4031138##k I'll give you....... How about it?."); 
} 

function action(mode, type, selection) { 
    if (mode < 1) { 
        cm.dispose(); 
        return; 
          }
    if(cm.haveItem(4031138,1)) {
	 cm.gainItem(.......,1);
     cm.gainItem(4031138,-1);
    cm.warp(910000000);
    cm.sendOk("Thank you! Press @help for the commands!");
                } else
                    cm.sendOk("Sorry, you don't have #b#v4031138##k! Come back when you do!");
                cm.dispose();
				}

Your welcome.

You send NPC Chat on start function only if it disposes after the first chat. else, the end chat button will give NPC Error.
 
Upvote 0
Back