Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- prefix: &8[&a&oToken&8]
- line: &a&m---------&8&m---------[&r &a&l㊬ &a&l&oTokens &a&l㊬&r &8&m]---------&a&m---------
- #Permission for every single command for this script
- permission-admin: token.admin
- #Permission for players to see other players token balance:
- permission-balance-others: token.balance.others
- #Permission for paying other players with tokens
- permission-pay: token.pay
- #Permission for giving player tokens
- permission-give: token.give
- #Permission for taking away tokens from player
- permission-take: token.take
- #Permission for reseting players token balance
- permission-reset: token.reset
- #Permission for withdrawing tokens to physical item
- permission-withdraw: token.withdraw
- #LANGUAGE (You can change every word here and it will sync to the code after you reload the script)
- #Message when player runs a unknown token command
- invalid-command: &7Invalid command, use &a&o/token help &7for more info!
- #Message when you run /token or /token bal(ance)
- token-balance: &dYou have &a&o%{token::balance::%player%}% &7token(s).
- #Message when you run /token bal(ance) <player>
- token-balance-others: &a&o%{_player}% &7has &a&o%{token::balance::%{_player}%}% &7token(s).
- #Message when player doesn't set player (/token pay)
- player-arg-not-set: &7Please specify the player!
- #Message when player doesn't set the amount (/token pay <player>)
- amount-arg-not-set: &7Please specify the amount!
- #Message when you try to pay yourself with tokens
- pay-yourself: &7Can't pay tokens to yourself!
- #Message when you pay someone with number 0 or below (/token pay <player> 0/-1)
- pay-0: &7Could not register that amount of tokens!
- #Message when player tryes to pay or withdraw and they don't have the amount of tokens they put to pay/withdraw
- not-enough-tokens: &7You don't have that many tokens!
- #Message when other player doesn't have enough money (/token take <player> <amount>)
- no-enough-tokens-other: &7Player doesn't have that many tokens!
- #Message when you pay to other player
- pay-succesfull-sender: &7You have paid &a&o%{_token}% &7token(s) to &a&o%{_player}%
- #Message other player gets when he recieves your payment
- pay-succesfull-reciever: &7You have recieved &a&o%{_token}% &7token(s) from &a&o%player%
- #Message when you withdraw tokens into an item (/token withdraw <amount>)
- withdraw-succesfull: &7You have withdrawed &a&o%{_token}% &7token(s) into a physical item.
- #Message when player is withdrawing but doesn't have enought space in their inventory
- no-space: &7You don't have enough space in your inventory!
- #Message when admin gives player tokens
- tokens-given: &7You have been given &a&o%{_token}% &7token(s).
- #Message when player has been taken tokens from their balance (/token take <player> <amount>)
- token-taken: &7You have been taken &a&o%{_token}% &7token(s).
- #Message when player tryes to run a command that they don't have permission for
- no-permission: &7You don't have permission to do this!
- #Message when you reset token balance of another player
- reset-player: &7You have reset token balance for &a&o%{_player}%
- #Message when yout token balance gets reset
- reset-to-player: &7Your token balance has been reset!
- #Message when the player right clicks the token item and recieves amount of tokens
- token-claim: &7You have claimed &a&o%{_token_amount}% &7token(s).
- #|================================================|#
- #| COMMANDS |#
- #|================================================|#
- command /token [<text>] [<text>] [<text>]:
- aliases: /t, /tokens
- trigger:
- if arg 1 is not "bal" or "balance" or "pay" or "give" or "take" or "reset" or "help" or "withdraw":
- message "{@prefix} {@invalid-command}"
- stop
- if arg 1 is not set:
- if "%{token::balance::%player%}%" is "<none>":
- set {token::balance::%player%} to 0
- message "{@prefix} {@token-balance}"
- stop
- if arg 1 is "help" or "?":
- message "{@line}"
- message "&a&o/Token bal(ance) [player] &7- Check your token balance &8| &o{@permission-balance-others}"
- message "&a&o/Token pay <player> <amount> &7- Pay other players with tokens &8| &o{@permission-pay}"
- message "&a&o/Token withdraw <amount> &7- Withdraws tokens to be physical item &8| &o{@permission-withdraw}"
- if player has permission "{@permission-admin}":
- message "&a&o/Token give <player> <amount> &7- Give player tokens &8| &o{@permission-give}"
- message "&a/Token take <player> <amount> &7- Take away tokens from player &8| &o{@permission-take}"
- message "&a&o/Token reset <player> &7- Set players tokens to 0 &8| &o{@permission-reset}"
- stop
- if arg 1 is "bal" or "balance":
- if arg 2 is not set:
- if "%{token::balance::%player%}%" is "<none>":
- set {token::balance::%player%} to 0
- message "{@prefix} {@token-balance}"
- else if arg 2 is set:
- if player has permission "{@permission-admin}" or "{@permission-balance-others}":
- set {_player} to arg 2 parsed as offlineplayer
- if "%{token::balance::%{_player}%}%" is "<none>":
- set {token::balance::%{_player}%} to 0
- message "{@prefix} {@token-balance-others}"
- stop
- else if player doesn't have permission "{@permission-admin}" or "{@permission-balance-others}":
- message "{@prefix} {@no-permission}"
- stop
- if arg 1 is "pay":
- if player has permission "{@permission-pay}" or "{@permission-admin}":
- set {_player} to arg 2 parsed as offlineplayer
- set {_text} to arg 3
- set {_token} to {_text} parsed as integer
- if arg 2 is not set:
- message "{@prefix} {@player-arg-not-set}"
- stop
- if arg 3 is not set:
- message "{@prefix} {@amount-arg-not-set}"
- stop
- if {_player} is player:
- message "{@prefix} {@pay-yourself}"
- stop
- if {_token} is less than or equal to 0:
- message "{@prefix} {@pay-0}"
- stop
- if arg 2 is set:
- if arg 3 is set:
- if {token::balance::%player%} is less than {_token}:
- message "{@prefix} {@not-enough-tokens}"
- stop
- else:
- remove {_token} from {token::balance::%player%}
- add {_token} to {token::balance::%{_player}%}
- message "{@prefix} {@pay-succesfull-sender}" to player
- message "{@prefix} {@pay-succesfull-reciever}" to {_player}
- stop
- else if player doesn't have permission "{@permission-admin}" or "{@permission-pay}":
- message "{@prefix} {@no-permission}"
- stop
- if arg 1 is "withdraw":
- if player has permission "{@permission-admin}" or "{@permission-withdraw}":
- set {_text} to arg 2
- set {_token} to {_text} parsed as integer
- if arg 2 is not set:
- message "{@prefix} {@amount-arg-not-set}"
- stop
- if {token::balance::%player%} is less than {_token}:
- message "{@prefix} {@not-enough-tokens}"
- stop
- else:
- if player has enough space for 1 magma cream:
- remove {_token} from {token::balance::%player%}
- 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)."
- message "{@prefix} {@withdraw-succesfull}"
- stop
- else:
- message "{@prefix} {@no-space}"
- if {_token} is less than or equal to 0:
- message "{@prefix} {@pay-0}"
- stop
- else if player doesn't have permission "{@permission-admin}" or "{@permission-withdraw}":
- message "{@prefix} {@no-permission}"
- stop
- if arg 1 is "give":
- if player has permission "{@permission-admin}" or "{@permission-give}":
- set {_player} to arg 2 parsed as offlineplayer
- set {_text} to arg 3
- set {_token} to {_text} parsed as integer
- if arg 2 is not set:
- message "{@prefix} {@player-arg-not-set}"
- stop
- if arg 3 is not set:
- message "{@prefix} {@amount-arg-not-set}"
- stop
- if arg 2 is set:
- if arg 3 is set:
- add {_token} to {token::balance::%{_player}%}
- message "{@prefix} {@tokens-given}"
- stop
- else if player doesn't have permission "{@permission-admin}" or "{@permission-give}":
- message "{@prefix} {@no-permission}"
- stop
- if arg 1 is "take":
- if player has permission "{@permission-admin}" or "{@permission-take}":
- set {_player} to arg 2 parsed as offlineplayer
- set {_text} to arg 3
- set {_token} to {_text} parsed as integer
- if arg 2 is not set:
- message "{@prefix} {@player-arg-not-set}"
- stop
- if arg 3 is not set:
- message "{@prefix} {@amount-arg-not-set}"
- stop
- if arg 2 is set:
- if arg 3 is set:
- if {token::balance::%{_player}%} is less than {_token}:
- message "{@prefix} {@no-enough-tokens-other}"
- stop
- else:
- remove {_token} from {token::balance::%{_player}%}
- message "{@prefix} {@token-taken}"
- stop
- else if player doesn't have permission "{@permission-admin}" or "{@permission-give}":
- message "{@prefix} {@no-permission}"
- stop
- if arg 1 is "reset":
- if player has permission "{@permission-admin}" or "{@permission-reset}":
- set {_player} to arg 2 parsed as offlineplayer
- if arg 2 is not set:
- message "{@prefix} {@player-arg-not-set}"
- stop
- else:
- set {token::balance::%{_player}%} to 0
- message "{@prefix} {@reset-player}" to player
- message "{@prefix} {@reset-to-player}" to {_player}
- stop
- else if player doesn't have permission "{@permission-admin}" or "{@permission-give}":
- message "{@prefix} {@no-permission}"
- stop
- #|================================================|#
- #| EVENTS |#
- #|================================================|#
- on right click on sign:
- if line 1 of event-block is "[Token]":
- if line 2 of event-block is "balance":
- set line 1 of event-block to "&8[&a&oToken&8]"
- set line 2 of event-block to "&7Check your"
- set line 3 of event-block to "&7token balance"
- set line 4 of event-block to ""
- stop
- if line 3 of event-block is "&7token balance":
- make player execute "/token"
- stop
- on right click holding magma cream:
- if lore of player's held item contains "token":
- set {_token_amount} to name of held item parsed as integer
- add {_token_amount} to {token::balance::%player%}
- remove held item from player
- message "{@prefix} {@token-claim}"
- stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement