Error: "test(P: player) is not a text"
code:
code:
Code:
function depositAll(P: player):
set {bank::%{_P}%} to {bank::%{_P}%} + {_P}'s balance
set {_P}'s balance to 0
function depositHalf(P: player):
set {_b} to {_P}'s balance / 2
set {bank::%{_P}%} to {bank::%{_P}%} + {_b}
set {_P}'s balance to {_b}
function withdrawAll(P: player):
set {_P}'s balance to {_P}'s balance + {bank::%{_P}%}
set {bank::%{_P}%} to 0
function withdrawHalf(P: player):
set {_b} to {bank::%{_P}%} / 2
set {_P}'s balance to {_P}'s balance + {_b}
set {bank::%{_P}%} to {_b}
function depositOpen(P: player):
open chest with 3 row named "&eBank" to {_P}
wait 1 tick
format slot 11 of {_P} with 64 chests named "&aDeposit All Of Your Coins" with lore "&7Store all your coins in the bank" to close then run [depositAll({_P})]
format slot 15 of {_P} with 32 chests named "&aDeposit Half Of Your Coins" with lore "&7Store half your coins in the bank" to close then run [depositHalf({_P})]
function withdrawOpen(P: player):
open chest with 3 row named "&eBank" to {_P}
wait 1 tick
format slot 11 of {_P} with 64 chests named "&aWithdraw All Of Your Coins" with lore "&7Take all your coins from the bank" to close then run [withdrawAll({_P})]
format slot 15 of {_P} with 32 chests named "&aWithdraw Half Of Your Coins" with lore "&7Take half your coins from the bank" to close then run [withdrawHalf({_P})]
command /bank:
trigger:
open chest with 3 row named "&eBank" to player
wait 1 tick
format slot 11 of player with chest named "&aDeposit Coins" with lore "&7Store your coins in the bank" to run [depositOpen(player)]
format slot 15 of player with chest named "&aWithdraw Coins" with lore "&7Take your coins out of the bank" to run [withdrawOpen(player)]