Advertisement
AutismAlex

steal

Dec 14th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. command steal(target){
  2. permission = "steal";
  3. execute(){
  4. if(isSet(target)){
  5. target = toPlayer(target)
  6. if(isSet(target)){
  7. if(target.balance >= 10000){
  8. amount = random.int(0, 10000);
  9. }
  10. else{
  11. amount = random.int(0, target.balance);
  12. }
  13. target.decreaseBalance(amount);
  14. target.message(player.name + " has stolen " + amount + " balance from you!");
  15. player.increaseBalance(amount);
  16. player.message("You stole " + amount + " from " + target.name);
  17. }
  18. else{
  19. player.message("Could not find player with that name);
  20. }
  21. }
  22. else{
  23. player.message("Usage: /steal <player name>");
  24. }
  25. target = toPlayer(target)
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement