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 variable can only be set to one object, not more

Discussion in 'Skript' started by GamingGeek, Feb 13, 2018.

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

    Supporter

    Joined:
    Aug 1, 2017
    Messages:
    46
    Likes Received:
    0
    I'm trying to make a Skript where if a server uses MyBB forums, players can link their profile by setting their profile id to a variable, and server owners can use the variable in other Skripts. However, I want to make it so the user does the command '/linkmyforums {insert MyBB profile URL here}' and it splits the url at = so it only get's the UID.

    Here's my forums profile:
    https://forums.spectralmc.tk/member.php?action=profile&UID=1

    I want it to set the variable to the 1 in that URL. Here's my current code:
    Code (Skript):
    1. command /linkmyforums [<string>]:
    2.     trigger:
    3.         if arg-1 is not set:
    4.             send "{@ErrorColor}{@B}No Profile Found! Please do {@SecondaryColor}/linkmyforums <your profile URL>" to player
    5.         else if arg-1 contains "member.php?action=profile": #This is to verify that it's a valid MyBB URL
    6.             set {profileid.%player%} to arg-1 split at "="
    When reloading the skript, I get this error...
    upload_2018-2-13_16-26-11.png
     
  2. Best Answer:
    Post #2 by ChisleLP, Feb 13, 2018
  3. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    60
    doing varaibles list, then you can spilt there

    set {profileid.%player%::*} to arg-1 split at "="

    then should be

    {profileid.%player%::1} = "URL"
    {profileid.%player%::2} = UID
     
  4. Wynnevir

    Wynnevir Well-Known Member

    Joined:
    Jul 9, 2017
    Messages:
    1,016
    Likes Received:
    62
    If you are going to spit something then the variable you set it to needs to be a list variable. {profileid.%player%::*}
    You can then set one element of that list to a single variable or reference it as an index of that list.
    Set {variable} to {profileid.%player%::2}
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...