Advertisement
Xgod22052

tokens skript

Mar 22nd, 2021
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.32 KB | None | 0 0
  1.  
  2. options:
  3. prefix: &8[&a&oToken&8]
  4. line: &a&m---------&8&m---------[&r &a&l㊬ &a&l&oTokens &a&l㊬&r &8&m]---------&a&m---------
  5.  
  6. #Permission for every single command for this script
  7. permission-admin: token.admin
  8.  
  9. #Permission for players to see other players token balance:
  10. permission-balance-others: token.balance.others
  11.  
  12. #Permission for paying other players with tokens
  13. permission-pay: token.pay
  14.  
  15. #Permission for giving player tokens
  16. permission-give: token.give
  17.  
  18. #Permission for taking away tokens from player
  19. permission-take: token.take
  20.  
  21. #Permission for reseting players token balance
  22. permission-reset: token.reset
  23.  
  24. #Permission for withdrawing tokens to physical item
  25. permission-withdraw: token.withdraw
  26.  
  27.  
  28. #LANGUAGE (You can change every word here and it will sync to the code after you reload the script)
  29.  
  30. #Message when player runs a unknown token command
  31. invalid-command: &7Invalid command, use &a&o/token help &7for more info!
  32.  
  33. #Message when you run /token or /token bal(ance)
  34. token-balance: &dYou have &a&o%{token::balance::%player%}% &7token(s).
  35.  
  36. #Message when you run /token bal(ance) <player>
  37. token-balance-others: &a&o%{_player}% &7has &a&o%{token::balance::%{_player}%}% &7token(s).
  38.  
  39. #Message when player doesn't set player (/token pay)
  40. player-arg-not-set: &7Please specify the player!
  41.  
  42. #Message when player doesn't set the amount (/token pay <player>)
  43. amount-arg-not-set: &7Please specify the amount!
  44.  
  45. #Message when you try to pay yourself with tokens
  46. pay-yourself: &7Can't pay tokens to yourself!
  47.  
  48. #Message when you pay someone with number 0 or below (/token pay <player> 0/-1)
  49. pay-0: &7Could not register that amount of tokens!
  50.  
  51. #Message when player tryes to pay or withdraw and they don't have the amount of tokens they put to pay/withdraw
  52. not-enough-tokens: &7You don't have that many tokens!
  53.  
  54. #Message when other player doesn't have enough money (/token take <player> <amount>)
  55. no-enough-tokens-other: &7Player doesn't have that many tokens!
  56.  
  57. #Message when you pay to other player
  58. pay-succesfull-sender: &7You have paid &a&o%{_token}% &7token(s) to &a&o%{_player}%
  59.  
  60. #Message other player gets when he recieves your payment
  61. pay-succesfull-reciever: &7You have recieved &a&o%{_token}% &7token(s) from &a&o%player%
  62.  
  63. #Message when you withdraw tokens into an item (/token withdraw <amount>)
  64. withdraw-succesfull: &7You have withdrawed &a&o%{_token}% &7token(s) into a physical item.
  65.  
  66. #Message when player is withdrawing but doesn't have enought space in their inventory
  67. no-space: &7You don't have enough space in your inventory!
  68.  
  69. #Message when admin gives player tokens
  70. tokens-given: &7You have been given &a&o%{_token}% &7token(s).
  71.  
  72. #Message when player has been taken tokens from their balance (/token take <player> <amount>)
  73. token-taken: &7You have been taken &a&o%{_token}% &7token(s).
  74.  
  75. #Message when player tryes to run a command that they don't have permission for
  76. no-permission: &7You don't have permission to do this!
  77.  
  78. #Message when you reset token balance of another player
  79. reset-player: &7You have reset token balance for &a&o%{_player}%
  80.  
  81. #Message when yout token balance gets reset
  82. reset-to-player: &7Your token balance has been reset!
  83.  
  84. #Message when the player right clicks the token item and recieves amount of tokens
  85. token-claim: &7You have claimed &a&o%{_token_amount}% &7token(s).
  86.  
  87.  
  88.  
  89. #|================================================|#
  90. #| COMMANDS |#
  91. #|================================================|#
  92.  
  93. command /token [<text>] [<text>] [<text>]:
  94. aliases: /t, /tokens
  95. trigger:
  96. if arg 1 is not "bal" or "balance" or "pay" or "give" or "take" or "reset" or "help" or "withdraw":
  97. message "{@prefix} {@invalid-command}"
  98. stop
  99. if arg 1 is not set:
  100. if "%{token::balance::%player%}%" is "<none>":
  101. set {token::balance::%player%} to 0
  102. message "{@prefix} {@token-balance}"
  103. stop
  104. if arg 1 is "help" or "?":
  105. message "{@line}"
  106. message "&a&o/Token bal(ance) [player] &7- Check your token balance &8| &o{@permission-balance-others}"
  107. message "&a&o/Token pay <player> <amount> &7- Pay other players with tokens &8| &o{@permission-pay}"
  108. message "&a&o/Token withdraw <amount> &7- Withdraws tokens to be physical item &8| &o{@permission-withdraw}"
  109. if player has permission "{@permission-admin}":
  110. message "&a&o/Token give <player> <amount> &7- Give player tokens &8| &o{@permission-give}"
  111. message "&a/Token take <player> <amount> &7- Take away tokens from player &8| &o{@permission-take}"
  112. message "&a&o/Token reset <player> &7- Set players tokens to 0 &8| &o{@permission-reset}"
  113. stop
  114.  
  115. if arg 1 is "bal" or "balance":
  116. if arg 2 is not set:
  117. if "%{token::balance::%player%}%" is "<none>":
  118. set {token::balance::%player%} to 0
  119. message "{@prefix} {@token-balance}"
  120. else if arg 2 is set:
  121. if player has permission "{@permission-admin}" or "{@permission-balance-others}":
  122. set {_player} to arg 2 parsed as offlineplayer
  123. if "%{token::balance::%{_player}%}%" is "<none>":
  124. set {token::balance::%{_player}%} to 0
  125. message "{@prefix} {@token-balance-others}"
  126. stop
  127. else if player doesn't have permission "{@permission-admin}" or "{@permission-balance-others}":
  128. message "{@prefix} {@no-permission}"
  129. stop
  130. if arg 1 is "pay":
  131. if player has permission "{@permission-pay}" or "{@permission-admin}":
  132. set {_player} to arg 2 parsed as offlineplayer
  133. set {_text} to arg 3
  134. set {_token} to {_text} parsed as integer
  135. if arg 2 is not set:
  136. message "{@prefix} {@player-arg-not-set}"
  137. stop
  138. if arg 3 is not set:
  139. message "{@prefix} {@amount-arg-not-set}"
  140. stop
  141. if {_player} is player:
  142. message "{@prefix} {@pay-yourself}"
  143. stop
  144. if {_token} is less than or equal to 0:
  145. message "{@prefix} {@pay-0}"
  146. stop
  147. if arg 2 is set:
  148. if arg 3 is set:
  149. if {token::balance::%player%} is less than {_token}:
  150. message "{@prefix} {@not-enough-tokens}"
  151. stop
  152. else:
  153. remove {_token} from {token::balance::%player%}
  154. add {_token} to {token::balance::%{_player}%}
  155. message "{@prefix} {@pay-succesfull-sender}" to player
  156. message "{@prefix} {@pay-succesfull-reciever}" to {_player}
  157. stop
  158. else if player doesn't have permission "{@permission-admin}" or "{@permission-pay}":
  159. message "{@prefix} {@no-permission}"
  160. stop
  161. if arg 1 is "withdraw":
  162. if player has permission "{@permission-admin}" or "{@permission-withdraw}":
  163. set {_text} to arg 2
  164. set {_token} to {_text} parsed as integer
  165. if arg 2 is not set:
  166. message "{@prefix} {@amount-arg-not-set}"
  167. stop
  168. if {token::balance::%player%} is less than {_token}:
  169. message "{@prefix} {@not-enough-tokens}"
  170. stop
  171. else:
  172. if player has enough space for 1 magma cream:
  173. remove {_token} from {token::balance::%player%}
  174. give player 1 magma cream named "%{_token}%" with lore "&7This is a physical token. To claim it||&7simply &fright-click &7and claim tokens!||||&7Withdrawed by- &a&o%player%||&7Amount- &a&o%{_token}% &7token(s)."
  175. message "{@prefix} {@withdraw-succesfull}"
  176. stop
  177. else:
  178. message "{@prefix} {@no-space}"
  179. if {_token} is less than or equal to 0:
  180. message "{@prefix} {@pay-0}"
  181. stop
  182. else if player doesn't have permission "{@permission-admin}" or "{@permission-withdraw}":
  183. message "{@prefix} {@no-permission}"
  184. stop
  185. if arg 1 is "give":
  186. if player has permission "{@permission-admin}" or "{@permission-give}":
  187. set {_player} to arg 2 parsed as offlineplayer
  188. set {_text} to arg 3
  189. set {_token} to {_text} parsed as integer
  190. if arg 2 is not set:
  191. message "{@prefix} {@player-arg-not-set}"
  192. stop
  193. if arg 3 is not set:
  194. message "{@prefix} {@amount-arg-not-set}"
  195. stop
  196. if arg 2 is set:
  197. if arg 3 is set:
  198. add {_token} to {token::balance::%{_player}%}
  199. message "{@prefix} {@tokens-given}"
  200. stop
  201. else if player doesn't have permission "{@permission-admin}" or "{@permission-give}":
  202. message "{@prefix} {@no-permission}"
  203. stop
  204. if arg 1 is "take":
  205. if player has permission "{@permission-admin}" or "{@permission-take}":
  206. set {_player} to arg 2 parsed as offlineplayer
  207. set {_text} to arg 3
  208. set {_token} to {_text} parsed as integer
  209. if arg 2 is not set:
  210. message "{@prefix} {@player-arg-not-set}"
  211. stop
  212. if arg 3 is not set:
  213. message "{@prefix} {@amount-arg-not-set}"
  214. stop
  215. if arg 2 is set:
  216. if arg 3 is set:
  217. if {token::balance::%{_player}%} is less than {_token}:
  218. message "{@prefix} {@no-enough-tokens-other}"
  219. stop
  220. else:
  221. remove {_token} from {token::balance::%{_player}%}
  222. message "{@prefix} {@token-taken}"
  223. stop
  224. else if player doesn't have permission "{@permission-admin}" or "{@permission-give}":
  225. message "{@prefix} {@no-permission}"
  226. stop
  227. if arg 1 is "reset":
  228. if player has permission "{@permission-admin}" or "{@permission-reset}":
  229. set {_player} to arg 2 parsed as offlineplayer
  230. if arg 2 is not set:
  231. message "{@prefix} {@player-arg-not-set}"
  232. stop
  233. else:
  234. set {token::balance::%{_player}%} to 0
  235. message "{@prefix} {@reset-player}" to player
  236. message "{@prefix} {@reset-to-player}" to {_player}
  237. stop
  238. else if player doesn't have permission "{@permission-admin}" or "{@permission-give}":
  239. message "{@prefix} {@no-permission}"
  240. stop
  241. #|================================================|#
  242. #| EVENTS |#
  243. #|================================================|#
  244.  
  245. on right click on sign:
  246. if line 1 of event-block is "[Token]":
  247. if line 2 of event-block is "balance":
  248. set line 1 of event-block to "&8[&a&oToken&8]"
  249. set line 2 of event-block to "&7Check your"
  250. set line 3 of event-block to "&7token balance"
  251. set line 4 of event-block to ""
  252. stop
  253.  
  254. if line 3 of event-block is "&7token balance":
  255. make player execute "/token"
  256. stop
  257.  
  258. on right click holding magma cream:
  259. if lore of player's held item contains "token":
  260. set {_token_amount} to name of held item parsed as integer
  261. add {_token_amount} to {token::balance::%player%}
  262. remove held item from player
  263. message "{@prefix} {@token-claim}"
  264. stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement