Solved variable can only be set to one object, not more

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

GamingGeek

Supporter
Aug 1, 2017
46
0
0
21
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_language.skript:
command /linkmyforums [<string>]:
    trigger:
        if arg-1 is not set:
            send "{@ErrorColor}{@B}No Profile Found! Please do {@SecondaryColor}/linkmyforums <your profile URL>" to player
        else if arg-1 contains "member.php?action=profile": #This is to verify that it's a valid MyBB URL
            set {profileid.%player%} to arg-1 split at "="
When reloading the skript, I get this error...
upload_2018-2-13_16-26-11.png
 
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
 
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
Reactions: Spygain
Status
Not open for further replies.