Solved Pay system

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

Hartvig

Member
Apr 18, 2017
39
1
0
22
Info:
It gives me no errors when i reload the skript, the problem is i can send more keys than i have, and i can aslo send a key type that is'nt gold, iron, or diamond.

arg 1 is player
arg 2 is a number
arg 3 is a type (Iron,Gold,Diamond)
Variables:
{jern.pol.%player%}
{guld.pol.%player%}
{dia.pol.%player%}

Code
code_language.skript:
command /keypay [<offline player>] [<text>] [<text>]:
    aliases: /kpay
    trigger:
        if arg 1 is set:
            if arg 2 is set:
                if arg 2 is greater than {%arg 3%.pol.%player%}:
                    send "&cFejl.. Du har ikke nok poletter, eller polet typen findes ikke!"
                else:
                    if arg 3 is set:
                        add arg 2 to {%arg 3%.pol.%arg 1%}
                        remove arg 2 from {%arg 3%.pol.%player%}
                        send "&aSucess! Du har sendt %arg 2% %arg 3% poletter til %arg 1%" to player
                        send "&aDu har modtaget %arg 2% %arg 3% poletter fra %player%" to arg 1
                    else:
                        send "&cHusk hvilken slags key! &ee.x /kpay Hartvig 12 guld"
            else:
                send "&cHusk antal keys! &ee.x /kpay Hartvig 12 guld"
        else:
            send "&cHusk spillerens navn! &ee.x /kpay Hartvig 12 guld"
 
The problem it: You didn't parsed as integer...

and you can canelt if they type other name, just do:

code_language.skript:
if arg-3 is "Gold" or "Diamonds" or "Iron":
    #todo
else:
    send "WHAT? Only Diamonds, iron, gold!"
 
It gives me errors,
error:
code_language.skript:
add arg 2 to {pol.%arg 3%.%arg 1%} parsed as a integer
can't have anything added to it
 
It gives me errors,
error:
code_language.skript:
add arg 2 to {pol.%arg 3%.%arg 1%} parsed as a integer
can't have anything added to it
For the 3rd time it’s because you didn’t parse it as an integer. Surprise surprise.

Why don’t you just make the argument an integer instead of text so you don’t need to parse it
 
For the 3rd time it’s because you didn’t parse it as an integer. Surprise surprise.

Why don’t you just make the argument an integer instead of text so you don’t need to parse it
thank you. i didn't know were to pass as integer, but ty
 
Status
Not open for further replies.