desert,41,51,5 script 50/50 Game 504,{
set .WinningRate,30;
mes "[ Gambit ]";
mes "Do you want to gamble ?";
if( select("Yes:No") == 2 ) close;
next;
set .itemID,40001; // Set ID Gold Coin
mes "[ Gambit ]";
mes "This is a betting game with a 30% win rate";
mes "Just bet the amount you want and push your luck !";
next;
mes "[ Gambit ]";
mes "Do you want to gamble your "+getitemname( .itemID )+" with a "+.WinningRate+" % Win rate?";
next;
if( select("Yes:No") == 2 ) close;
mes "[ Gambit ]";
mes "Enter amount of "+getitemname( .itemID )+" you want to gamble";
input .Amount;
next;
mes "[ Gambit ]";
mes "Are you sure you want to gamble "+.Amount+" Gold Coin ?";
next;
if( select("Yes:No") == 2 ) close;
if( countitem( .itemID ) < .Amount ){
mes "[ Gambit ]";
mes "You dont have enough "+getitemname( .itemID )+" to gamble.";
}else{
delitem .itemID,.Amount;
if( rand(100) < .WinningRate ){
mes "[ Gambit ]";
mes "Congratulations ! You won !";
getitem 607,10*.Amount;
}else{
mes "[ Gambit ]";
mes "Sad ! You lost. Better luck next time !";
}
}
close;
}