Jump to content
  • 0

Requesting Event Dice roll


Question

Posted

Example:

this number for dice roll

1:

2:

3:

4:

5:

6:

 

Player choose one for dice roll if the player choose number 4 then the npc roll the dice .the result of roll is 6 the player is lost.

if player choose number 1 then the npc roll the again . the result is 1 the player win times two of prize

2 answers to this question

Recommended Posts

Posted

Try : 

prontera,150,150,0    script    Sample    100,{
    // Item ID,Amount
    setarray .prize,7227,5;
    if ( countitem(.prize[0]) < .prize[1] ) {
        mes "You need to have " + .prize[1] + " " +getitemname(.prize[0]);
        close;
    }
    mes "Input your number";
    next;
    input .@guess,1,6;
    mes "Roll roll roll ~";
    next;
    .random_number = rand(1,6);
    
    if ( .@guess == .random_number ) {
        getitem .prize[0], (2 * .prize[1]);
        mes "You got it! (" +.@guess+ ")";
    } else {
        delitem .prize[0], .prize[1];
        mes "Better luck next time!";
        mes "NPC number : " +.random_number;
        mes "Your number : " +.@guess;
    }
    close;
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...