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.

Need help with skript

Discussion in 'Skript' started by Ankhz, Sep 26, 2019.

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

    Ankhz Member

    Joined:
    Sep 26, 2019
    Messages:
    2
    Likes Received:
    0
    Hi i have this code
    Code (Text):
    1.  
    2. create a gui with virtual chest with 1 rows named "Banco":          
    3.     format gui 3 with gold block named "&aCantidad personalizada":
    4.         set {cuentas-banco::chat::%player%} to true
    5.         depositarpersonal(player)
    6.  
    7.  
    8.  
    9.  
    10. function depositarpersonal(p: player):
    11.     close inventory of {_p}  
    12.     send "&aEscribe la cantidad que quieras depositar&f." to {_p}
    13.     while {banco::%{_p}%::dinerotemp} is not set:
    14.         wait 10 ticks
    15.     if {banco::%{_p}%::dinerotemp} is set:
    16.         if balance of {_p} is less than {banco::%{_p}%::dinerotemp}:
    17.             send "&cNo tienes esa cantidad de dinero." to {_p}
    18.             delete {banco::%{_p}%::dinerotemp}
    19.             stop            
    20.         else:
    21.             #execute console command "money take %{_p}% %{banco::%{_p}%::dinerotemp}%"
    22.             remove {banco::%{_p}%::dinerotemp} from balance of {_p}
    23.             add {banco::%{_p}%::dinerotemp} to {cuentas-banco::%{_p}%}          
    24.             send "&aDepositaste %{banco::%{_p}%::dinerotemp}% &f." to {_p}
    25.             delete {banco::%{_p}%::dinerotemp}    
    26.             set {cuentas-banco::chat::%{_p}%} to false
    27.             stop              
    28.  
    29.  
    30. on chat:  
    31.     if {cuentas-banco::chat::%player%} is true:
    32.         cancel event      
    33.         set {banco::%player%::dinerotemp} to message
    34.         stop
    35.  
    work everything except the conditions with balance dont work :/ i dont know why, dont throw me any error :/ can you help me pls?
     
  2. TPGamesNL

    Moderator Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    When you set the variable to `message`, it will be saved as a text. And you cannot compare a number with a text, so you will have to parse the message as a number (parse)
     
  3. Ankhz

    Ankhz Member

    Joined:
    Sep 26, 2019
    Messages:
    2
    Likes Received:
    0
    Thank you so much bro!!! it works!!! Yesterday I broke my head trying to fix it (sory its my 4th day learning a language). Have an excellent day bro!
     
  4. TPGamesNL

    Moderator Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    You're welcome, have a great day!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...