ArtzifyHD

Bank Skript

Jul 14th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. command /bank [<text>] [<number>]:
  2. trigger:
  3. if arg 1 is not set:
  4. open chest with 3 rows named "&9Bank" to player
  5. wait 1 tick
  6. set {_d} to 0
  7. set {antal::%player%} to 0
  8. loop 31 times:
  9. if loop-number is not 4, 11 or 15:
  10. format slot {_d} of player with gray glass named "" with lore "" to be unstealable
  11. add 1 to {_d}
  12. format slot 4 of player with diamond named "&2Bank account:" with lore "&cBalance: &a$ %{Bank::%player%}%" to be unstealable
  13. format slot 15 of player with name_tag named "&CDeposit money" with lore "Add money to your bank account" to run [execute player command "/bank input"]
  14. format slot 11 of player with paper named "&CWithdraw money" with lore "Remove money from your bank account" to run [execute player command "/bank output"]
  15. if arg 1 is "output":
  16. if arg 2 is set:
  17. set {_negativt} to "%arg 2%"
  18. if {_negativt} contains "-":
  19. send "&cCan't be a negative number!"
  20. stop
  21. if {Bank::%player%} >= {antal::%player%}:
  22. add {antal::%player%} to player's balance
  23. remove {antal::%player%} from {Bank::%player%}
  24. send "&2You withdraw &a$ %{antal::%player%}% &2from your bank account."
  25. send "&2Your balance&7: &a $ %player's balance%"
  26. delete {antal::%player%}
  27. stop
  28. else:
  29. send "&2Not enaught money at your bank account"
  30. delete {antal::%player%}
  31. else:
  32. open chest with 3 rows named "&2Withdraw money" to player
  33. wait 1 tick
  34. set {_d} to 0
  35. set {antal::%player%} to 0
  36. loop 33 times:
  37. if loop-number is not 2, 4, 6, 11, 13, 15 or 26:
  38. format slot {_d} of player with gray glass named "" with lore "" to be unstealable
  39. add 1 to {_d}
  40. format slot 2 of player with iron ingot named "&2Add 1000" to run [add 1000 to {antal::%player%}]
  41. format slot 4 of player with gold ingot named "&2Add 10000" to run [add 10000 to {antal::%player%}]
  42. format slot 6 of player with diamond named "&2Add 100000" to run [add 100000 to {antal::%player%}]
  43. format slot 11 of player with iron ingot named "&4Remove 1000" to run [remove 1000 from {antal::%player%}]
  44. format slot 13 of player with gold ingot named "&4Remove 10000" to run [remove 10 from {antal::%player%}]
  45. format slot 15 of player with diamond named "&4Remove 100000" to run [remove 100000 from {antal::%player%}]
  46. format slot 18 of player with Emerald named "&2Accept" to close then run [execute player command "/bank output %{antal::%player%}%"]
  47. format slot 26 of player with redstone named "&4Voltar" to close then run [delete {antal::%player%}]
  48. while inventory name of player's current inventory is "&2Withdraw money":
  49. format slot 22 of player with paper named "&2Total to withdraw:" with lore "%{antal::%player%}%" to be unstealable
  50. wait 1 tick
  51. if arg 1 is "input":
  52. if arg 2 is set:
  53. set {_negativt} to "%arg 2%"
  54. if {_negativt} contains "-":
  55. send "&cCan't be a negative number!"
  56. stop
  57. if player's balance >= {antal::%player%}:
Add Comment
Please, Sign In to add comment