How to list multiple values in variable

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

Kolombooo

Active Member
Dec 3, 2020
51
3
8
Hey,
I need to list all the values in some variable to appear in chat. My current code looks like this
Code:
    if arg 1 is "add":
      set {%arg-2%::ploc} to location of player
      add arg-2 to {_projects::*}
      broadcast "&8[&aBuild&8] &7New project has been created: &a%arg-2%"
    if arg 1 is "list":
      send "" to player
      send "&a&lPROJECTS"
      send "&7%{_projects::*}%"
      send "" to player

But the "&7%{_projects::*}%" shows like "<none>"
 
Hey, could you send me the full code? Makes it easier for me to help you.
Here you go
Code:
command /project [<text>] [<text>]:
  permission: build.command
  permission message: &8[&aBuild&8] &7Na tento příkaz nemáš dostatečné oprávnění
  trigger:
    if arg 1 is not set:
      make player execute command "project help"
    if arg 1 is "help":
      send "" to player
      send "&a&lPŘÍKAZY PRO BUILDERY" to player
      send "&8• &a/project tp [Název] &7- Teleportovat se na projekt"
      send "&8• &a/project add [Název] &7- Založit nový projekt"
      send "&8• &a/project list &7- Zobrazit vytvořené projekty"
      send ""
    if arg 1 is "add":
      if {%arg-2%::created} = 1:
        send "&8[&aBuild&8] &7Tento projekt již existuje"
      else:
        execute console command "mvc project_%arg-2% normal -t flat"
        add arg-2 to {_projects::*} 
        send "&8[&aBuild&8] &7Vytvářím projekt..." to player
        wait 5 seconds
        broadcast "&8[&aBuild&8] &7Byl vytvořen nový projekt &a%arg-2%"
        set {%arg-2%::ploc} to location at (0.5, 60, 0.5) in world "project_%arg-2%" parsed as world
        set {%arg-2%::created} to 1
        make player execute command "project tp %arg-2%"         
    if arg 1 is "tp":
      if {%arg-2%::created} = 1:
        teleport player to {%arg-2%::ploc}
        send "&8[&aBuild&8] &7Byl jsi teleportován na projekt &a%arg-2%"       
      else:
        send "&8[&aBuild&8] &7Tento projekt neexistuje"       
    if arg 1 is "list":
      send "" to player
      send "&a&lPROJEKTY"
      send "&7%{_projects::*}%"
      send "" to player
Don't mind of the language
 
Status
Not open for further replies.