Bug 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 community!

    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.

PuchiGFX

Member
Jan 26, 2017
246
5
18
I have an error/bug with loop:
My code:
code_language.skript:
        loop {sufijos::*}:
            if {_n} is 17 or 26 or 35:
                add 2 to {_n}
            format slot {_n} of player with {_item} named "%coloured loop-value%" with lore "&7Click izquierdo para seleccionar el tag:|| &8[&8%coloured loop-value%&8]" to close then run [execute player command "suffix %coloured loop-value%"]
            add 1 to {_n}
Bug:
The gui works perfectly, but when i select a suffix, i select the last loop-value and i don't know why
I use skript 2.2-dev25
And spigot 1.8
 
when i select a suffix, i select the last loop-value
Could you explain a little better?

Are you saying that if you select the first suffix it runs the same command than the last one?

The code should be working.
 
Could you explain a little better?

Are you saying that if you select the first suffix it runs the same command than the last one?

The code should be working.
Ik, but it selects the last loop-value ._.
 
I have an error/bug with loop:
My code:
code_language.skript:
        loop {sufijos::*}:
            if {_n} is 17 or 26 or 35:
                add 2 to {_n}
            format slot {_n} of player with {_item} named "%coloured loop-value%" with lore "&7Click izquierdo para seleccionar el tag:|| &8[&8%coloured loop-value%&8]" to close then run [execute player command "suffix %coloured loop-value%"]
            add 1 to {_n}
Bug:
The gui works perfectly, but when i select a suffix, i select the last loop-value and i don't know why
I use skript 2.2-dev25
And spigot 1.8
Ok first of all do not use format slot use TuSKe Gui manager https://github.com/Tuke-Nuke/TuSKe/wiki/GUI-Manager
Can you send a little more code like what is {_item}? What did you add to the list?
Btw no need to add colored loop value
 
The reason why your code selects the last loop-value is because of a SkQuery format bug with lambdas.
 
Oh, okey, and what can i do for fix it? use tuske manager?
Yes, it's the only GUI manager that fixes this problem. Besides, TuSKe's GUI manager is better in general because it has more advanced stuff and fixes the bugs from SkQuery format.
 
Status
Not open for further replies.