Hey!
I'm trying to do a tax plugin which gets the balance of both online and offline players. My issue is that I can't seem to get the balance of the offline player, it just returns <none> when they have $1000. I'm not sure why
Thanks!
I'm trying to do a tax plugin which gets the balance of both online and offline players. My issue is that I can't seem to get the balance of the offline player, it just returns <none> when they have $1000. I'm not sure why
Code:
on join:
if "%{newlogins::*}%" contains "%player%":
stop
add player to {newlogins::*}
broadcast "Success"
command /taxeveryone:
trigger:
broadcast "Tax has been collected! As the tax code is HIGH FLAT, everyone has been taxed the same at 0.8%%. The next round of tax collection will occur in 3 hours."
broadcast "Taxes go to the treasury and is distributed to pay for healthcare, transport, welfare amongst other government-run programmes!"
loop {newlogins::*}:
set {_bal} to balance of loop-value
# A 1% tax, you can make it whatever you want
set {_tax} to {_bal}*0.03
remove {_tax} from loop-value's balance
if loop-value is not online:
set {_newbal} to balance of loop-value
send "%loop-value%"
send "Old balance %{_newbal}%"
set {_newtax} to {_newbal}*0.03
send "Tax removed from player %{_newtax}%"
remove {_newtax} from the money of player data of loop-value
Thanks!