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.

Loop a list variable in a list variable.

Discussion in 'Skript' started by sandor_1234, Aug 16, 2017.

Thread Status:
Not open for further replies.
  1. sandor_1234

    sandor_1234 Active Member

    Joined:
    Jan 26, 2017
    Messages:
    165
    Likes Received:
    5
    So i am making a faction skript and i have stored my faction data under {f::factions::[Faction Name]::[Data type]}
    So for example: {f::factions::Immortal::creator} would store the creator of the faction.
    Is there any way i could loop all factions?
    I tried this:
    Code (Skript):
    1. loop {f::factions::*}:
    But that returns nothing as expected.
    Are there any other ways to "loop" the whole faction part?
     
  2. Best Answer:
    Post #2 by ShaneBee, Aug 16, 2017
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    MundoSK has the following expression:
    Code (Skript):
    1. tree of %objects%
    Which can only be used on loops, here is an example of it:

    Code (Skript):
    1. loop tree of {f::factions::*}:
    2.  
    3.   set {_current-index::*} to branch split by "::"
    4.   set {_faction-name} to {_current-index::1}
    5.   set {_data-type} to {_current-index::2}
    6.  
    7.   if {_data-type} is "balance":
    8.     set {_balanceTop::%{_faction-name}%} to loop-value
     
Thread Status:
Not open for further replies.

Share This Page

Loading...