Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- minBet = 1;
- maxBet = 10000;
- minMultiplier = 2;
- maxMultiplier = 10;
- currencyName = "credits";
- system = "experience";
- // script
- command bet(multiplier, amount){
- permission = "bet";
- execute(){
- if(arguments.count > 1){
- if(multiplier >= minMultiplier and multiplier <= maxMultiplier){
- if(amount >= minBet and amount <= maxBet){
- if(system == "uconomy"){
- if(player.balance >= amount){
- roll = random.int(1, 101);
- max = 100/multiplier;
- if(roll <= max){
- mp = multiplier - 1;
- win = amount * mp;
- player.increaseBalance(win);
- player.message(str.format("You won {0} {1}!", win, currencyName));
- }
- else{
- player.decreaseBalance(amount);
- player.message(str.format("You lost {0} {1}!", amount, currencyName));
- }
- }
- else{
- player.message("You do not have enough funds!");
- }
- }
- else{
- if(player.experience >= amount){
- roll = random.int(1, 101);
- max = 100/multiplier;
- if(roll <= max){
- mp = multiplier - 1;
- win = amount * mp;
- player.experience = player.experience + win;
- player.message(str.format("You won {0} {1}!", win, currencyName));
- }
- else{
- player.experience = player.experience - amount;
- player.message(str.format("You lost {0} {1}!", amount, currencyName));
- }
- }
- else{
- player.message("You do not have enough funds!");
- }
- }
- }
- else{
- player.message(str.format("The minimum amount is {0} and the maximum is {1}", minBet, maxBet));
- }
- }
- else{
- player.message(str.format("The minimum multiplier is {0} and the maximum is {1}", minMultiplier, maxMultiplier));
- }
- }
- else{
- player.message("Correct Usage: /bet <Multiplier> <Amount>");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement