1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Functions are not working...

Discussion in 'Skript' started by ViperX, Jul 28, 2022.

Thread Status:
Not open for further replies.
  1. ViperX

    ViperX Member

    Joined:
    Jul 26, 2022
    Messages:
    26
    Likes Received:
    0
    Error: "test(P: player) is not a text"
    code:
    Code (Text):
    1. function depositAll(P: player):
    2.     set {bank::%{_P}%} to {bank::%{_P}%} + {_P}'s balance
    3.     set {_P}'s balance to 0
    4.  
    5. function depositHalf(P: player):
    6.     set {_b} to {_P}'s balance / 2
    7.     set {bank::%{_P}%} to {bank::%{_P}%} + {_b}
    8.     set {_P}'s balance to {_b}
    9.  
    10. function withdrawAll(P: player):
    11.     set {_P}'s balance to {_P}'s balance + {bank::%{_P}%}
    12.     set {bank::%{_P}%} to 0
    13.  
    14. function withdrawHalf(P: player):
    15.     set {_b} to {bank::%{_P}%} / 2
    16.     set {_P}'s balance to {_P}'s balance + {_b}
    17.     set {bank::%{_P}%} to {_b}
    18.  
    19. function depositOpen(P: player):
    20.     open chest with 3 row named "&eBank" to {_P}
    21.     wait 1 tick
    22.     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})]
    23.     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})]
    24.    
    25. function withdrawOpen(P: player):
    26.     open chest with 3 row named "&eBank" to {_P}
    27.     wait 1 tick
    28.     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})]
    29.     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})]
    30.  
    31. command /bank:
    32.     trigger:
    33.         open chest with 3 row named "&eBank" to player
    34.         wait 1 tick
    35.         format slot 11 of player with chest named "&aDeposit Coins" with lore "&7Store your coins in the bank" to run [depositOpen(player)]
    36.         format slot 15 of player with chest named "&aWithdraw Coins" with lore "&7Take your coins out of the bank" to run [withdrawOpen(player)]
     
Thread Status:
Not open for further replies.

Share This Page

Loading...