Solved Loop problem

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

GiorgixPRO

Member
Jul 29, 2017
44
0
0
25
Hello guys I have another problem, when I run this code:

Code:
command /vip [<player>] [<text>]:
    trigger:
        if arg 1 is set:
            if arg 2 is "Terrestrial":
                loop all players:
                    send loop-players title "&6%arg 1% &aha comprato il pacchetto:" with subtitle "&6VIP Terrestrial&a!" for 5 seconds
                    add "chat.terrestrial.prefix" to arg 1's permissions
                    add "kit.test.permission" to arg 1's permissions
                    add "playervaults.amount.2" to arg 1's permissions
                    add "hat.hat" to arg 1's permissions
                    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.
 
Hello guys I have another problem, when I run this code:

Code:
command /vip [<player>] [<text>]:
    trigger:
        if arg 1 is set:
            if arg 2 is "Terrestrial":
                loop all players:
                    send loop-players title "&6%arg 1% &aha comprato il pacchetto:" with subtitle "&6VIP Terrestrial&a!" for 5 seconds
                    add "chat.terrestrial.prefix" to arg 1's permissions
                    add "kit.test.permission" to arg 1's permissions
                    add "playervaults.amount.2" to arg 1's permissions
                    add "hat.hat" to arg 1's permissions
                    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.

Trying removing the code
code_language.skript:
make console execute command "money give %arg 1% 5000"
line from the loop all players.
Something like that:
code_language.skript:
command /vip [<player>] [<text>]:
    trigger:
        if arg 1 is set:
            if arg 2 is "Terrestrial":
                loop all players:
                    send loop-players title "&6%arg 1% &aha comprato il pacchetto:" with subtitle "&6VIP Terrestrial&a!" for 5 seconds
                add "chat.terrestrial.prefix" to arg 1's permissions
                add "kit.test.permission" to arg 1's permissions
                add "playervaults.amount.2" to arg 1's permissions
                add "hat.hat" to arg 1's permissions
                make console execute command "money give %arg 1% 5000"
 
Trying removing the code
code_language.skript:
make console execute command "money give %arg 1% 5000"
line from the loop all players.
Something like that:
code_language.skript:
command /vip [<player>] [<text>]:
    trigger:
        if arg 1 is set:
            if arg 2 is "Terrestrial":
                loop all players:
                    send loop-players title "&6%arg 1% &aha comprato il pacchetto:" with subtitle "&6VIP Terrestrial&a!" for 5 seconds
                add "chat.terrestrial.prefix" to arg 1's permissions
                add "kit.test.permission" to arg 1's permissions
                add "playervaults.amount.2" to arg 1's permissions
                add "hat.hat" to arg 1's permissions
                make console execute command "money give %arg 1% 5000"
Thanks, now works correctly!
 
Status
Not open for further replies.