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 Please help me with loop

Discussion in 'Skript' started by ezmann!44, Jul 8, 2017.

Thread Status:
Not open for further replies.
  1. ezmann!44

    ezmann!44 Member

    Joined:
    Jul 2, 2017
    Messages:
    35
    Likes Received:
    1
    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 (Skript):
    1. set {_result1::*} to objects in column "ban" from result of query "SELECT `ban` FROM `server_ban`.`history` WHERE uuid = '%{_punished}'s uuid%'" and close
    2.     set {_result2::*} to objects in column "by" from result of query "SELECT `by` FROM `server_ban`.`history` WHERE uuid = '%{_punished}'s uuid%'" and close
    3.     loop {_result1::*}:
    4.         loop {_result2::*}:
    5.             set {_amount1} to loop-value-1
    6.             if "%{_amount1}%" contains "Chat Offense":
    7.                 add 1 to {_slot}
    8.                 set slot {_slot} of {_executer}'s current inventory to book and quill named "%{_colorTitle2}%Chat Offense" with lore ""
    9.             if "%{_amount1}%" contains "Hacking":
    10.                 add 1 to {_slot}
    11.                 set slot {_slot} of {_executer}'s current inventory to iron sword named "%{_colorTitle2}%Client Mod" with lore "%{_result2::*}%"
    12.             if {_slot} = 54:
    13.                 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?
    --- Double Post Merged, Jul 9, 2017, Original Post Date: Jul 8, 2017 ---
    bump
    --- Double Post Merged, Jul 10, 2017 ---
    fixed
     
Thread Status:
Not open for further replies.
Loading...