Solved Please help me with loop

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

ezmann!44

Member
Jul 2, 2017
35
1
0
26
I have this script that will get ban history of player and will place it in a GUI. When i use this script,
it will place 50 items instead of 8 and this will be the Lore of the items:

BeatTheBeat,BeatTheBeat,BeatTheBeat,BeatTheBeat,BeatTheBeat,BeatTheBeat,BeatTheBeat,BeatTheBeat.

I dont know how to fix it because im not good with loops and stuff so it
would be nice if someone could fix it / tell me how to fix it. Thank you


code_language.skript:
set {_result1::*} to objects in column "ban" from result of query "SELECT `ban` FROM `server_ban`.`history` WHERE uuid = '%{_punished}'s uuid%'" and close
    set {_result2::*} to objects in column "by" from result of query "SELECT `by` FROM `server_ban`.`history` WHERE uuid = '%{_punished}'s uuid%'" and close
    loop {_result1::*}:
        loop {_result2::*}:
            set {_amount1} to loop-value-1
            if "%{_amount1}%" contains "Chat Offense":
                add 1 to {_slot}
                set slot {_slot} of {_executer}'s current inventory to book and quill named "%{_colorTitle2}%Chat Offense" with lore ""
            if "%{_amount1}%" contains "Hacking":
                add 1 to {_slot}
                set slot {_slot} of {_executer}'s current inventory to iron sword named "%{_colorTitle2}%Client Mod" with lore "%{_result2::*}%"
            if {_slot} = 54:
                stop

It is a little bit confusing if you don't know SQL stuff but it basically grabs the info from a simple table.
I don't get the loop bit so if you're good at skript you might be able to help?
[doublepost=1499606640,1499548339][/doublepost]bump
[doublepost=1499641882][/doublepost]fixed
 
Status
Not open for further replies.