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 Loop problem

Discussion in 'Skript' started by GiorgixPRO, Jul 26, 2019.

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

    GiorgixPRO Member

    Joined:
    Jul 29, 2017
    Messages:
    44
    Likes Received:
    0
    Hello guys I have another problem, when I run this code:

    Code (Text):
    1. command /vip [<player>] [<text>]:
    2.     trigger:
    3.         if arg 1 is set:
    4.             if arg 2 is "Terrestrial":
    5.                 loop all players:
    6.                     send loop-players title "&6%arg 1% &aha comprato il pacchetto:" with subtitle "&6VIP Terrestrial&a!" for 5 seconds
    7.                     add "chat.terrestrial.prefix" to arg 1's permissions
    8.                     add "kit.test.permission" to arg 1's permissions
    9.                     add "playervaults.amount.2" to arg 1's permissions
    10.                     add "hat.hat" to arg 1's permissions
    11.                     make console execute command "money give %arg 1% 5000"
    When I run this code all the permissions are added fine but the money give command runs twice so the player gets 10k money instead of 5k and i cant understand why.
    Thanks for the help.
     
  2. Best Answer:
    Post #2 by couger44, Jul 26, 2019
  3. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    Trying removing the code
    Code (Skript):
    1. make console execute command "money give %arg 1% 5000"
    line from the loop all players.
    Something like that:
    Code (Skript):
    1.  
    2. command /vip [<player>] [<text>]:
    3.     trigger:
    4.         if arg 1 is set:
    5.             if arg 2 is "Terrestrial":
    6.                 loop all players:
    7.                     send loop-players title "&6%arg 1% &aha comprato il pacchetto:" with subtitle "&6VIP Terrestrial&a!" for 5 seconds
    8.                 add "chat.terrestrial.prefix" to arg 1's permissions
    9.                 add "kit.test.permission" to arg 1's permissions
    10.                 add "playervaults.amount.2" to arg 1's permissions
    11.                 add "hat.hat" to arg 1's permissions
    12.                 make console execute command "money give %arg 1% 5000"
     
  4. GiorgixPRO

    GiorgixPRO Member

    Joined:
    Jul 29, 2017
    Messages:
    44
    Likes Received:
    0
    Thanks, now works correctly!
     
  5. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    You're welcome. Remember mark the post as solved.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...