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 set SECOND element of ...

Discussion in 'Skript' started by Flynn_LG, Nov 24, 2019.

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

    Flynn_LG Member

    Joined:
    Nov 4, 2019
    Messages:
    38
    Likes Received:
    1
    Hey guys!

    How can I set a second element of ... to an another variable?

    Code (Text):
    1. set {_day} to second element out of {_datum::*}
    Thanks!


    Sry for my bad english:emoji_grin:(German)

     
  2. Best Answer:
    Post #3 by AsuDev, Nov 24, 2019
  3. malia

    malia Well-Known Member

    Joined:
    Jul 24, 2019
    Messages:
    314
    Likes Received:
    21
    I don't know how Skript does it, but {_datum::*} is supposed to be an array, so {_datum::2} or {_datum::1} should be the second element, not sure which one because in programming we start with 0 as the first position, try it out :emoji_slight_smile:
     
  4. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    243
    Likes Received:
    21
    {_datum::2} would be the second element in a basic Skript list. Here is the docs for getting an element from a list:
    https://skripthub.net/docs/?id=942

    Example:
    Code (Skript):
    1. set {_day} to 3rd element of {_datum::*}
    2. set {_month} to 5th element of {_datum::*}
    3. #etc
     
    #3 AsuDev, Nov 24, 2019
    Last edited: Nov 24, 2019
    • Agree Agree x 1
  5. Flynn_LG

    Flynn_LG Member

    Joined:
    Nov 4, 2019
    Messages:
    38
    Likes Received:
    1
Thread Status:
Not open for further replies.

Share This Page

Loading...