Need help with skript

  • 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.

Ankhz

Member
Sep 26, 2019
2
0
1
44
Hi i have this code
Code:
create a gui with virtual chest with 1 rows named "Banco":           
    format gui 3 with gold block named "&aCantidad personalizada":
        set {cuentas-banco::chat::%player%} to true
        depositarpersonal(player)




function depositarpersonal(p: player):
    close inventory of {_p}   
    send "&aEscribe la cantidad que quieras depositar&f." to {_p}
    while {banco::%{_p}%::dinerotemp} is not set:
        wait 10 ticks
    if {banco::%{_p}%::dinerotemp} is set:
        if balance of {_p} is less than {banco::%{_p}%::dinerotemp}:
            send "&cNo tienes esa cantidad de dinero." to {_p}
            delete {banco::%{_p}%::dinerotemp}
            stop             
        else:
            #execute console command "money take %{_p}% %{banco::%{_p}%::dinerotemp}%"
            remove {banco::%{_p}%::dinerotemp} from balance of {_p}
            add {banco::%{_p}%::dinerotemp} to {cuentas-banco::%{_p}%}           
            send "&aDepositaste %{banco::%{_p}%::dinerotemp}% &f." to {_p} 
            delete {banco::%{_p}%::dinerotemp}     
            set {cuentas-banco::chat::%{_p}%} to false
            stop               


on chat:   
    if {cuentas-banco::chat::%player%} is true:
        cancel event       
        set {banco::%player%::dinerotemp} to message
        stop

work everything except the conditions with balance dont work :/ i dont know why, dont throw me any error :/ can you help me pls?
 
Hi i have this code
Code:
create a gui with virtual chest with 1 rows named "Banco":         
    format gui 3 with gold block named "&aCantidad personalizada":
        set {cuentas-banco::chat::%player%} to true
        depositarpersonal(player)




function depositarpersonal(p: player):
    close inventory of {_p} 
    send "&aEscribe la cantidad que quieras depositar&f." to {_p}
    while {banco::%{_p}%::dinerotemp} is not set:
        wait 10 ticks
    if {banco::%{_p}%::dinerotemp} is set:
        if balance of {_p} is less than {banco::%{_p}%::dinerotemp}:
            send "&cNo tienes esa cantidad de dinero." to {_p}
            delete {banco::%{_p}%::dinerotemp}
            stop           
        else:
            #execute console command "money take %{_p}% %{banco::%{_p}%::dinerotemp}%"
            remove {banco::%{_p}%::dinerotemp} from balance of {_p}
            add {banco::%{_p}%::dinerotemp} to {cuentas-banco::%{_p}%}         
            send "&aDepositaste %{banco::%{_p}%::dinerotemp}% &f." to {_p}
            delete {banco::%{_p}%::dinerotemp}   
            set {cuentas-banco::chat::%{_p}%} to false
            stop             


on chat: 
    if {cuentas-banco::chat::%player%} is true:
        cancel event     
        set {banco::%player%::dinerotemp} to message
        stop

work everything except the conditions with balance dont work :/ i dont know why, dont throw me any error :/ can you help me pls?
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)
 
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)

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!
 
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!
You're welcome, have a great day!
 
Status
Not open for further replies.