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.

Solved Pay system

Discussion in 'Skript' started by Hartvig, Oct 17, 2017.

Tags:
Thread Status:
Not open for further replies.
  1. Hartvig

    Hartvig Member

    Joined:
    Apr 18, 2017
    Messages:
    39
    Likes Received:
    1
    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 (Skript):
    1. command /keypay [<offline player>] [<text>] [<text>]:
    2.     aliases: /kpay
    3.     trigger:
    4.         if arg 1 is set:
    5.             if arg 2 is set:
    6.                 if arg 2 is greater than {%arg 3%.pol.%player%}:
    7.                     send "&cFejl.. Du har ikke nok poletter, eller polet typen findes ikke!"
    8.                 else:
    9.                     if arg 3 is set:
    10.                         add arg 2 to {%arg 3%.pol.%arg 1%}
    11.                         remove arg 2 from {%arg 3%.pol.%player%}
    12.                         send "&aSucess! Du har sendt %arg 2% %arg 3% poletter til %arg 1%" to player
    13.                         send "&aDu har modtaget %arg 2% %arg 3% poletter fra %player%" to arg 1
    14.                     else:
    15.                         send "&cHusk hvilken slags key! &ee.x /kpay Hartvig 12 guld"
    16.             else:
    17.                 send "&cHusk antal keys! &ee.x /kpay Hartvig 12 guld"
    18.         else:
    19.             send "&cHusk spillerens navn! &ee.x /kpay Hartvig 12 guld"
     
  2. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    60
    The problem it: You didn't parsed as integer...

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

    Code (Skript):
    1. if arg-3 is "Gold" or "Diamonds" or "Iron":
    2.     #todo
    3. else:
    4.     send "WHAT? Only Diamonds, iron, gold!"
     
  3. Hartvig

    Hartvig Member

    Joined:
    Apr 18, 2017
    Messages:
    39
    Likes Received:
    1
    Thank you, but i can still send more keys than i have
    --- Double Post Merged, Oct 17, 2017, Original Post Date: Oct 17, 2017 ---
    @ChisleLP
     
  4. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    60
    Cuz you didn't parsed it as integer...

    You don't need mentioned/pumped.
     
  5. Hartvig

    Hartvig Member

    Joined:
    Apr 18, 2017
    Messages:
    39
    Likes Received:
    1
    It gives me errors,
    error:
    Code (Skript):
    1. add arg 2 to {pol.%arg 3%.%arg 1%} parsed as a integer
    can't have anything added to it
     
  6. Donut

    Donut Well-Known Member

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    176
    Medals:
    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
     
  7. Hartvig

    Hartvig Member

    Joined:
    Apr 18, 2017
    Messages:
    39
    Likes Received:
    1
    thank you. i didn't know were to pass as integer, but ty
     
Thread Status:
Not open for further replies.

Share This Page

Loading...