How I can do it?

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

DrackNife

Member
Jul 11, 2017
16
0
0
34
code_language.skript:
command /swp [<text>] [<text>]:
    aliases: /skywarsplus
    executable by: players
    trigger:
        if arg 1 is "create":
            if arg 2 is set:
                add arg 2 to {swp.arena::*}
                send "&aArena ""%arg-2%"" created!"
            else:
                send "&4Write a name of arena."
        else if arg 1 is "setmainlobby":
            if {swp.arena::*} has arg 2: #Here!
                send "&aworking!"

How I can specify an item of list variable ?
 
code_language.skript:
command /swp [<text>] [<text>]:
    aliases: /skywarsplus
    executable by: players
    trigger:
        if arg 1 is "create":
            if arg 2 is set:
                add arg 2 to {swp.arena::*}
                send "&aArena ""%arg-2%"" created!"
            else:
                send "&4Write a name of arena."
        else if arg 1 is "setmainlobby":
            if {swp.arena::*} has arg 2: #Here!
                send "&aworking!"

How I can specify an item of list variable ?
You can use
code_language.skript:
if {swp.arena::*} contains arg 2

However that has never worked for me (idk if it works for you or other people) so this is what i use
code_language.skript:
loop {swp.arena::*}:
    if loop-value is arg 2:
 
You can use
code_language.skript:
if {swp.arena::*} contains arg 2

However that has never worked for me (idk if it works for you or other people) so this is what i use
code_language.skript:
loop {swp.arena::*}:
    if loop-value is arg 2:
contains on lists variables isn't reliable, here's a function you can use instead
code_language.skript:
function contains(l: objects, v: object) :: boolean:
  return not (random element out of ({_l::*} where [object input is {_v}]) == null)
 
contains on lists variables isn't reliable, here's a function you can use instead
code_language.skript:
function contains(l: objects, v: object) :: boolean:
  return not (random element out of ({_l::*} where [object input is {_v}]) == null)

I don't know how execute it or how put in my code ;-;
 
Status
Not open for further replies.