Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ▒██████ ▒██████████ #
- # ▒██ ▒██ ▒████ ▒███████ ▒████ ▒███████ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██████ ▒██ ▒██████ ▒████████ ▒████████ #
- # ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▀▀ #
- # ▒██ ▒██ ▒██ ▒██ ▒███████ ▒██ ▒██ ▒███████ ▒██ ▒██████████ ▒████ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒████████ #
- # ▒██████ ▒████████ ▒██ ▒████████ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██████ ▒██ ▒██████ ▒██ ▒██ #
- # ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ #
- # ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒███████ ▒███████ ▒██████████ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒████████ #
- on load:
- if file "plugins/Skript/scripts/RCash/data.yml" doesn't exists:
- create file "plugins/Skript/scripts/RCash/data.yml"
- function AddCash(p: player, quantidade: integer):
- set {_cash} to value "%{_p}%.Cash" get of "plugins/Skript/scripts/RCash/data.yml"
- set {_cash} to {_cash} parsed as integer
- add {_quantidade} to {_cash}
- set "%{_p}%.Cash" to "%{_cash}%" in yaml file "plugins/Skript/scripts/RCash/data.yml"
- function SetCash(p: player, quantidade: integer):
- set "%{_p}%.Cash" to "%{_quantidade}%" in yaml file "plugins/Skript/scripts/RCash/data.yml"
- function RemoveCash(p: player, quantidade: integer):
- set {_cash} to value "%{_p}%.Cash" get of "plugins/Skript/scripts/RCash/data.yml"
- set {_cash} to {_cash} parsed as integer
- remove {_quantidade} from {_cash}
- set "%{_p}%.Cash" to "%{_cash}%" in yaml file "plugins/Skript/scripts/RCash/data.yml"
- function pegarCash(p: player) :: integer:
- set {_cash} to value "%{_p}%.Cash" get of "plugins/Skript/scripts/RCash/data.yml"
- set {_cash} to {_cash} parsed as integer
- return {_cash}
- function RandomKey(p: player, coins: integer) :: text:
- add "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y" and "Z" to {_keygen::*}
- add "1", "2", "3", "4", "5", "6", "7", "8", "9" and "0" to {_keygen::*}
- set {_s1} to "%random element out of {_keygen::*}%"
- set {_s2} to "%random element out of {_keygen::*}%"
- set {_s3} to "%random element out of {_keygen::*}%"
- set {_s4} to "%random element out of {_keygen::*}%"
- set {_s5} to "%random element out of {_keygen::*}%"
- set {_s6} to "%random element out of {_keygen::*}%"
- set {_s7} to "%random element out of {_keygen::*}%"
- set {_s8} to "%random element out of {_keygen::*}%"
- set {_s9} to "%random element out of {_keygen::*}%"
- set {_s10} to "%random element out of {_keygen::*}%"
- return "%{_s1}%%{_s2}%%{_s3}%%{_s4}%%{_s5}%%{_s6}%%{_s7}%%{_s8}%%{_s9}%%{_s10}%-%{_coins}%"
- function OneMessage(p: player, msg: text):
- set {_espera} to difference between {delay.%{_p}%} and now
- if {_espera} is less than 1 seconds:
- stop
- else:
- send "%coloured {_msg}%" to {_p}
- set {delay.%{_p}%} to now
- on join:
- #QUANDO ELE ENTRA SE O CASH N EXISTIR CRIA UM NOVO PLAYER
- set {_cash} to value "%player%.Cash" get of "plugins/Skript/scripts/RCash/data.yml"
- if {_cash} is not set:
- set "%player%.Cash" to "0" in yaml file "plugins/Skript/scripts/RCash/data.yml"
- command /gemas [<player>]:
- trigger:
- if player has permission "cash.usar":
- if arg 1 is not set:
- set {_cash} to pegarCash(player)
- send "&7Voce possui &c%{_cash}% &7de gemas."
- if arg 1 is set:
- set {_cash} to pegarCash(arg-1)
- send "&7Esse jogador possui &c%{_cash}% &7de gemas."
- else:
- send "&4➤ &cInfelismente você não possui permissão para isso."
- command /adicionargemas [<player>] [<integer>]:
- trigger:
- if player has permission "cash.admin":
- if arg 1 is set:
- if arg 2 is set:
- AddCash(arg-1, arg-2)
- send "&4➤ &7Voce adicionou &c%arg 2% &7gemas na conta de &c%arg 1%&7."
- else:
- send "&4➤ &cUtilize /adicionargemas <jogador> <quantia>."
- else:
- send "&4➤ &cUtilize /adicionargemas <jogador> <quantia>."
- else:
- send "&4➤ &cInfelismente você não possui permissão para isso."
- command /setargemas [<player>] [<integer>]:
- trigger:
- if player has permission "cash.admin":
- if arg 1 is set:
- if arg 2 is set:
- SetCash(arg-1, arg-2)
- send "&4➤ &7Voce setou a conta de &c%arg 1%&7 para &c%arg 2%&7."
- else:
- send "&4➤ &cUtilize /setargemas <jogador> <quantia>."
- else:
- send "&4➤ &cUtilize /setargemas <jogador> <quantia>."
- else:
- send "&4➤ &cInfelismente você não possui permissão para isso."
- command /removergemas [<player>] [<integer>]:
- trigger:
- if player has permission "cash.admin":
- if arg 1 is set:
- if arg 2 is set:
- RemoveCash(arg-1, arg-2)
- send "&4➤ &7Voce removeu &c%arg 2% &7gemas da conta de &c%arg 1%&7."
- else:
- send "&4➤ &cUtilize /removergemas <jogador> <quantia>."
- else:
- send "&4➤ &cUtilize /removergemas <jogador> <quantia>."
- else:
- send "&4➤ &cInfelismente você não possui permissão para isso."
- command /gerarkey [<integer>]:
- trigger:
- if player has permission "cash.admin":
- if arg 1 is set:
- set {_key} to RandomKey(player, arg-1)
- add "%{_key}%" to {keys::*}
- send "&4➤ &7Voce gerou a key: &c%{_key}%&7."
- else:
- send "&4➤ &cUtilize /gerarkey <quantia>."
- else:
- send "&4➤ &cInfelismente você não possui permissão para isso."
- command /apagarkey [<text>]:
- trigger:
- if player has permission "cash.admin":
- if arg 1 is not set:
- send "&7&m---------------&c[Keys]&7&m---------------"
- if size of {keys::*} = 0:
- send "&7Nenhuma key foi encontrada."
- send "&cUtilize /apagarkey <key>."
- else:
- loop {keys::*}:
- send "&7%loop-index% &f-&c %loop-value%"
- send "&7&m-----------------------------------"
- send "&4➤ &cUtilize /apagarkey <quantia>."
- if arg 1 is set:
- send "&4➤ &7Voce apagou a key: &c%{keys::%arg 1%}%"
- delete {keys::%arg 1%}
- else:
- send "&4➤ &cInfelismente você não possui permissão para isso."
- command /keylist:
- trigger:
- if player has permission "cash.admin":
- send "&7&m---------------&c[Keys]&7&m---------------"
- if size of {keys::*} = 0:
- send "&7Nenhuma key foi encontrada."
- send "&cUtilize /gerarkey <key>."
- else:
- loop {keys::*}:
- send "&7%loop-index% &f-&c %loop-value%"
- send "&7&m-----------------------------------"
- else:
- send "&4➤ &cInfelismente você não possui permissão para isso."
- command /ativar [<text>]:
- trigger:
- if player has permission "cash.usar":
- if arg 1 is set:
- if size of {keys::*} = 0:
- send "&4➤ &cInfelismente essa key não existe."
- else:
- loop {keys::*}:
- if "%loop-value%" = "%arg-1%":
- set {_key} to "%arg-1%"
- remove {_key} from {keys::*}
- set {_word::*} to {_key} split at "-"
- set {_coins} to {_word::2}
- set {_coins} to {_coins} parsed as integer
- send "&c&lCASH &7Processando, aguarde..."
- wait 2 seconds
- send "&c&lCASH &7Processamento concluido, key valida , aguarde..."
- wait 1 seconds
- AddCash(player, {_coins})
- send "&c&lCASH &7Voce ativou &c%{_coins}% &7gemas. Parabens!"
- broadcast "&c&lCASH &7O &c%player% &7ativou &c%{_coins}% &7gemas."
- stop loop
- else:
- OneMessage(player, "&4➤ Infelismente ocorreu um erro com essa key, aguarde...")
- else:
- send "&4➤ &cUtilize /ativar <key>."
- else:
- send "&4➤ &cInfelismente você não possui permissão para isso."
- #---------API---------
- #AddCash(player, <numero>) exemplo: AddCash(player, 100)
- #Tambem pode ser usado em qualquer lugar que tenha player exemplo
- #AddCash(victim, 100)
- #SetCash(player, 1000) #SET CASH PARA O PLAYER
- #RemoveCash(player, 900) REMOVE CASH DO PLAYER
- #set {_playercash} to pegarCash(player)
- #{_playercash} RETORNA A QUANTIDADE DE CASH DO PLAYER
- #EXEMPLO:
- #if {_playercash} >= 1000:
- # send "Voce comprou um kit por 1000 de Cash"
- # RemoveCash(player, 1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement