Quantcast
Channel: RaGEZONE - MMO Development Forums
Viewing all articles
Browse latest Browse all 32723

Simple selection NPC script not functioning

$
0
0
I took the script off Shawns NPC scripting guide, and added selection 2, as well as the 'Nice' var.
When I choose the last option, nothing happens(exists out of NPC).
Would appreciate help :)

PHP Code:

var yes "Good Job! You have enough Golden Maple Leafs!";
var 
no "I'm sorry, you don't have enough Golden Maple Leafs.";
var 
Nice "Nice man";
var 
status;

function 
start() {
    
status = -1;
    
action(100);
}

function 
action(modetypeselection) {
    if (
mode == 1) {
        
status++;
    }else{
        
status--;
    }
    if (
status == 0) {
        
cm.sendSimple("#L0# I have 10 Golden Maple Leafs #l \r\n#L1# I have 20 Golden Maple Leafs #l \r\n#L2# I have 1 golden leaf #l");
    }else if (
status == 1) {
        if (
selection == 0) {
            if (
cm.haveItem(400031310)) {
                
cm.sendOk(yes); 
                
cm.dispose();
            }else{
                
cm.sendOk("no");
                
cm.getItem(4000313,1);                    
                
cm.dispose();
            }
        } else if (
selection == 1) {
            if (
cm.haveItem(400031320)) {
                
cm.sendOk(yes);
                
cm.dispose();
            }else{
                
cm.sendOk(no);
                
cm.dispose();
            } if (
selection == 2) {
            if(
cm.haveItem(40003131)) {
            
cm.sendOk(Nice);
            
cm.dispose();
            } else {
          
cm.sendOk("Dam you're out man");
          
cm.dispose();
        }
    }  
 }
}



Viewing all articles
Browse latest Browse all 32723

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>