Functions are not working...

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

ViperX

Member
Jul 26, 2022
26
0
1
25
Error: "test(P: player) is not a text"
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)]
 
Status
Not open for further replies.