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 our 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 Problem with /pay command

Discussion in 'Skript' started by DieserTicket, Feb 11, 2019.

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

    DieserTicket Member

    Joined:
    Feb 11, 2019
    Messages:
    5
    Likes Received:
    0
    Hey i wanna make my own Economy with skript.
    My problem is when i use /pay ingame it doesnt do anything.
    and i dont know why.
    Maybe you can tell me why... heres my skript.

    Code (Text):
    1. on first join:
    2.     wait 5 seconds
    3.     message "&6&lGELD &8︳ &7Du hast dein Startkapital von &c500.000 Tokens &7erhalten."
    4.     set {tokens.%player%} to 500000
    5. command /geld [<player>] [<text>]:
    6.     trigger:
    7.         if arg 1 is not set:
    8.             message "&6&lGELD &8| &7Dein Kontostand: &c%{tokens.%player%}% Tokens"
    9.             stop
    10.         if arg 1 is set:
    11.             message "&6&lGELD &8| &7%arg 1%'s Kontostand: &c%{tokens.%arg 1%}% Tokens"
    12.            
    13. command /settokens [<player>] [<number>]:
    14.     permission: geld.setzen
    15.     permission message: &6&lGELD &8| &7Dazu fehlt dir die Berechtigung.
    16.     trigger:
    17.         if arg 1 is not set:
    18.             message "&6&lGELD &8| &7Benutze&8: &c/settokens &8(&cSpieler&8) (&cBetrag&8)"
    19.             stop
    20.         if arg 2 is not set:
    21.             message "&6&lGELD &8| &7Benutze&8: &c/settokens &8(&cSpieler&8) (&cBetrag&8)"
    22.             stop
    23.         if arg 2 is set:
    24.             set {tokens.%arg 1%} to arg 2
    25.             message "&6&lGELD &8| &7Der Kontostand von &c%arg 1% &7wurde auf &c%arg 2% &7gesetzt."
    26.             message "&6&lGELD &8| &7Dein Kontostand wurde auf &c%arg 2% &7gesetzt." to arg 1
    27. command /pay [<player>] [<number>]:
    28.     trigger:
    29.         if arg 1 is not set:
    30.             message "&6&lGELD &8| &7Benutze&8: &c/pay &8(&cSpieler&8) (&cBetrag&8)"
    31.         if arg 2 is not set:
    32.             message "&6&lGELD &8| &7Benutze&8: &c/pay &8(&cSpieler&8) (&cBetrag&8)"
    33.             if arg 2 is set:
    34.                 if arg 2 is more than {zero}:
    35.                     if arg 2 is smaller than {tokens.%player%}:
    36.                         remove arg 2 from {tokens.%player%}
    37.                         add arg 2 to {tokens.%arg 1%}
    38.                         message "&aErfolgreich"
    39.                         message "&bErfolgreich bekommen" to arg 1
    40.                         stop
    41.                     if arg 2 is more than {tokens.%player%}:
    42.                         message "&cDu hast nicht genug Geld!"
    43.                 if arg 2 is smaller than {zero}:
    44.                     message "&cBitte gebe einen Betrag über &70 &cein."
    45. command /startgeld [<text>]:
    46.     trigger:
    47.         if arg 1 is not set:
    48.             set {zero} to 0
    49.             message "&eErfolgreich!"
     
  2. Best Answer:
    Post #2 by TPGamesNL, Feb 11, 2019
  3. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    868
    Likes Received:
    50
    Medals:
    You added another tab at line 33 and beyond
     
    • Like Like x 1
  4. Runakai1

    Runakai1 Well-Known Member

    Joined:
    Apr 27, 2018
    Messages:
    323
    Likes Received:
    16
    Code (Skript):
    1.  
    2. command /settokens [<player>] [<number>]:
    3.     permission: geld.setzen
    4.     permission message: &6&lGELD &8| &7Dazu fehlt dir die Berechtigung.
    5.     trigger:
    6.         if arg-1 is set:
    7.             if arg-2 is set:
    8.                 set {tokens::%arg 1%} to arg 2
    9.                 message "&6&lGELD &8| &7Der Kontostand von &c%arg 1% &7wurde auf &c%arg 2% &7gesetzt."
    10.                 message "&6&lGELD &8| &7Dein Kontostand wurde auf &c%arg 2% &7gesetzt." to arg 1
    11.             else:
    12.                 send "&6&lGELD &8| &7Benutze&8: &c/settokens &8(&cSpieler&8) (&cBetrag&8)"
    13.         else:
    14.             send "&6&lGELD &8| &7Benutze&8: &c/settokens &8(&cSpieler&8) (&cBetrag&8)"
    I'd suggest you using this one. It is shorter and.. better.. : P And use list variables! Instead of {tokens.%player%} use --> {tokens::%uuid of player%} It'll be VERY handy in the future if you just edit the single dot to ::
     
    • Like Like x 1
  5. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    868
    Likes Received:
    50
    Medals:
    It isn't shorter :emoji_stuck_out_tongue:
     
  6. Runakai1

    Runakai1 Well-Known Member

    Joined:
    Apr 27, 2018
    Messages:
    323
    Likes Received:
    16
    it is! 1 line shorter... :emoji_stuck_out_tongue:
     
  7. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    868
    Likes Received:
    50
    Medals:
    Oh wow I forgot how to count lol
     
  8. Runakai1

    Runakai1 Well-Known Member

    Joined:
    Apr 27, 2018
    Messages:
    323
    Likes Received:
    16
    It's okay. We all do sometimes forget basic human functions. I, sometimes, forget to breathe!
     
    • Funny Funny x 3
Thread Status:
Not open for further replies.
Loading...