Advertisement
AutismAlex

uBet

Feb 5th, 2020
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. minBet = 1;
  2. maxBet = 10000;
  3. minMultiplier = 2;
  4. maxMultiplier = 10;
  5. currencyName = "credits";
  6. system = "experience";
  7.  
  8.  
  9. // script
  10.  
  11. command bet(multiplier, amount){
  12. permission = "bet";
  13. execute(){
  14. if(arguments.count > 1){
  15. if(multiplier >= minMultiplier and multiplier <= maxMultiplier){
  16. if(amount >= minBet and amount <= maxBet){
  17. if(system == "uconomy"){
  18. if(player.balance >= amount){
  19. roll = random.int(1, 101);
  20. max = 100/multiplier;
  21. if(roll <= max){
  22. mp = multiplier - 1;
  23. win = amount * mp;
  24. player.increaseBalance(win);
  25. player.message(str.format("You won {0} {1}!", win, currencyName));
  26. }
  27. else{
  28. player.decreaseBalance(amount);
  29. player.message(str.format("You lost {0} {1}!", amount, currencyName));
  30. }
  31. }
  32. else{
  33. player.message("You do not have enough funds!");
  34. }
  35. }
  36. else{
  37. if(player.experience >= amount){
  38. roll = random.int(1, 101);
  39. max = 100/multiplier;
  40. if(roll <= max){
  41. mp = multiplier - 1;
  42. win = amount * mp;
  43. player.experience = player.experience + win;
  44. player.message(str.format("You won {0} {1}!", win, currencyName));
  45. }
  46. else{
  47. player.experience = player.experience - amount;
  48. player.message(str.format("You lost {0} {1}!", amount, currencyName));
  49. }
  50. }
  51. else{
  52. player.message("You do not have enough funds!");
  53. }
  54. }
  55. }
  56. else{
  57. player.message(str.format("The minimum amount is {0} and the maximum is {1}", minBet, maxBet));
  58. }
  59. }
  60. else{
  61. player.message(str.format("The minimum multiplier is {0} and the maximum is {1}", minMultiplier, maxMultiplier));
  62. }
  63. }
  64. else{
  65. player.message("Correct Usage: /bet <Multiplier> <Amount>");
  66. }
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement