Problem with loops

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

giovigg

New Member
Nov 17, 2017
5
0
0
28
Why do I get the error "There are multiple loops that match value etc..." I tried putting loop-value-1 but it doesn't seem to work.

Code:
every second:
    loop all offline players:
        set {_pdurs::*} to objects in column "duration" from result of query "SELECT * FROM punishmentduration WHERE `name` ='%loop-offlineplayer%'"
        loop {_pdurs::*}:
            set {_pdurs} to loop-value
            if {_pdurs} is not set:
                stop
            else if {_pdurs} = 0:
                make console execute command "/pardon %loop-offlineplayer% Ban Expired"
            else if {_pdurs} = -1:
                stop
            else if {_pdurs} > 0:
                remove 1 from {_pdurs}
                update "UPDATE `punishmentduration` SET `duration` = '%{_pdurs}%' WHERE `punishmentduration`.`name` ='%loop-offlineplayer%'"
:
 
Hi, it also happened to me. before the server restart everything worked, after the restart it wrote me the same error.

Im making thirst skript

Code:
every 33 seconds:
    loop all players:
        remove 1 or 2 or 3 or 4 or 5 from {thirst::%loop-player%}

error.png
 
Last edited:
Why do I get the error "There are multiple loops that match value etc..." I tried putting loop-value-1 but it doesn't seem to work.

Code:
every second:
    loop all offline players:
        set {_pdurs::*} to objects in column "duration" from result of query "SELECT * FROM punishmentduration WHERE `name` ='%loop-offlineplayer%'"
        loop {_pdurs::*}:
            set {_pdurs} to loop-value
            if {_pdurs} is not set:
                stop
            else if {_pdurs} = 0:
                make console execute command "/pardon %loop-offlineplayer% Ban Expired"
            else if {_pdurs} = -1:
                stop
            else if {_pdurs} > 0:
                remove 1 from {_pdurs}
                update "UPDATE `punishmentduration` SET `duration` = '%{_pdurs}%' WHERE `punishmentduration`.`name` ='%loop-offlineplayer%'"
:
Try loop-value-2
 
Still Not working
Yea that post was actually meant for @giovigg, it fixed their issue in the parser.

For your issue, what is the code supposed to do? Pick a random number between 1 and 5 and remove that from a variable?
 
Status
Not open for further replies.