Jump to content
  • 0

Requesting Event Dice roll


Blue Jem

Question


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

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

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

ok i try then i post the error



is work thx alot :D

Link to comment
Share on other sites

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.

×
×
  • Create New...