command /pay [<player>] [<text>]:
cooldown: 5 seconds
cooldown message: &cYou need to wait %remaining time% before using this again!
trigger:
set {_amount} to rformat(arg-2)
if arg-1 is not set:
message "&cYou need to specify an online player!"
stop
if arg-2 is not set:
message "&cYou need to specify an amount!"
stop
set {_m} to arg-2
if player's balance < {_m}:
message "&cYou need $%player's balance - {_m}% to pay this amount!"
stop
remove arg-2 from player's balance
message "&aYou have successfully sent $%arg-2% to %arg-1%" to sender
message "&aYou have received $%arg-2% from %arg-1%" to arg-1
command /bal [<offlineplayer>]:
trigger:
if arg-1 is not set:
set {_p} to sender
else:
set {_p} to arg-1
set {_m} to balance of {_p}
send action bar "&a%{_p}%'s Balance: %formatt({_p}'s balance)%" to sender
play sound "minecraft:entity.player.levelup" at volume 1 at pitch 1 to player
function formatt(n: number) :: text:
set {_data} to "QT,18|Q,15|T,12|B,9|M,6|k,3"
loop split {_data} at "|":
set {_s::*} to split loop-value at ","
{_n} >= 10 ^ {_s::2} parsed as number
return "%{_n} / 10 ^ {_s::2} parsed as number%%{_s::1}%"
return "%{_n}%"
function rformat(s: string) :: number:
set {_s} to {_s} in lower case
loop ("k|m|b|t|qa|qi|sx|sp|oc" split at "|"):
add 1 to {_i} if {_s} partially matches "(\d|\.)(k|m|b|t|qa|qi|sx|sp|oc)"
set {_z::*} to split {_s} at loop-value
replace all "," in {_z::1} with ""
{_z::1} does not partially match "[^.0-9]":
return ({_z::1} parsed as number) * (10 ^ ({_i} * 3))
return 0
got 1 error
oop sorry
command /pay [<player>] [<text>]:
cooldown: 5 seconds
cooldown message: &cYou need to wait %remaining time% before using this again!
trigger:
set {_amount} to rformat(arg-2)
if arg-1 is not set:
message "&cYou need to specify an online player!"
stop
if arg-2 is not set:
message "&cYou need to specify an amount!"
stop
set {_m} to arg-2
if player's balance < {_m}:
message "&cYou need $%player's balance - {_m}% to pay this amount!"
stop
remove arg-2 from player's balance
message "&aYou have successfully sent $%arg-2% to %arg-1%" to sender
message "&aYou have received $%arg-2% from %arg-1%" to arg-1
function rformat(s: string) :: number:
set {_s} to {_s} in lower case
loop ("k|m|b|t|qa|qi|sx|sp|oc" split at "|"):
add 1 to {_i} if {_s} partially matches "(\d|\.)(k|m|b|t|qa|qi|sx|sp|oc)"
set {_z::*} to split {_s} at loop-value
replace all "," in {_z::1} with ""
{_z::1} does not partially match "[^.0-9]":
return ({_z::1} parsed as number) * (10 ^ ({_i} * 3))