Advertisement
Guest User

Untitled

a guest
May 17th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. @EventHandler
  2. public void playBedrockSlot(final PlayerInteractEvent e) {
  3. final Player p = e.getPlayer();
  4. final Random random = new Random();
  5. if (e.getAction() != Action.RIGHT_CLICK_BLOCK) {
  6. return;
  7. }
  8. if (e.getClickedBlock().getState() instanceof Sign) {
  9. final Sign s = (Sign) e.getClickedBlock().getState();
  10. if (s.getLine(2).equalsIgnoreCase("§8[§9RivalsPVP§8]") && s.getLine(1).equalsIgnoreCase("§0§lBedrock")) {
  11. final double bal = Core.econ.getBalance((OfflinePlayer) p);
  12. if (bal <= 499999.99) {
  13. p.sendMessage("§4Not enough money!");
  14. return;
  15. }
  16. Core.econ.withdrawPlayer((OfflinePlayer) p, 500000.0);
  17. double fivehunderk = plugin.getConfig().getDouble("dropChance", 1) / 3;
  18. if (random.nextDouble() <= fivehunderk) {
  19. Core.econ.depositPlayer(p, 500000.0);
  20. p.sendMessage("You have won 500k");
  21. return;
  22. }
  23. double onemil= plugin.getConfig().getDouble("dropChance", 1) / 8;
  24. if (random.nextDouble() <= onemil) {
  25. Core.econ.depositPlayer(p, 1000000.0);
  26. p.sendMessage("You have won q million");
  27. return;
  28. }
  29. double twomil= plugin.getConfig().getDouble("dropChance", 1) / 25;
  30. if (random.nextDouble() <= twomil) {
  31. Core.econ.depositPlayer(p, 2000000.0);
  32. p.sendMessage("You have won 2 million");
  33. return;
  34. }
  35. else {
  36. p.sendMessage("Sorry you did not win anything");
  37. return;
  38. }
  39. }
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement