Solved join wrong arena.

  • 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 community!

    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.

Uzumaki

Well-Known Member
Feb 20, 2017
310
10
18
code_language.skript:
                if size of {sw.arenas::*} is not 0:
                    send "&7Loading arenas..."
                    set {sw.arenas.menu} to 0
                    if size of {sw.arenas::*} <= 9:
                        open chest with 1 row named "SKYWARS ARENAS" to player
                        loop {sw.arenas::*}:
                            if {sw.arena.%loop-value%.status} is "{@ingame}":
                                format slot {sw.arenas.menu} of player with red clay named "&8 " with lore "&7Name&8: &e&l%loop-value%||&7Status&8: %{sw.arena.%loop-value%.status}%||&7Players&8: &7%{sw.arena.%loop-value%.playing}%/%{sw.arena.%loop-value%.max}%||||&a&oClick to join!" to close then run [make player execute command "sw join %loop-value%"]
                                add 1 to {sw.arenas.menu}
                            else:
                                format slot {sw.arenas.menu} of player with green clay named "&8 " with lore "&7Name&8: &e&l%loop-value%||&7Status&8: %{sw.arena.%loop-value%.status}%||&7Players&8: &7%{sw.arena.%loop-value%.playing}%/%{sw.arena.%loop-value%.max}%||||&a&oClick to join!" to close then run [make player execute command "sw join %loop-value%"]                                                  
                                add 1 to {sw.arenas.menu}
                        set {sw.arenas.menu} to 0
                        stop



every time i join to same/another arena
 
Last edited:
code_language.skript:
                if size of {sw.arenas::*} is not 0:
                    send "&7Loading arenas..."
                    set {sw.arenas.menu} to 0
                    if size of {sw.arenas::*} <= 9:
                        open chest with 1 row named "SKYWARS ARENAS" to player
                        loop {sw.arenas::*}:
                            if {sw.arena.%loop-value%.status} is "{@ingame}":
                                format slot {sw.arenas.menu} of player with red clay named "&8 " with lore "&7Name&8: &e&l%loop-value%||&7Status&8: %{sw.arena.%loop-value%.status}%||&7Players&8: &7%{sw.arena.%loop-value%.playing}%/%{sw.arena.%loop-value%.max}%||||&a&oClick to join!" to close then run [make player execute command "sw join %loop-value%"]
                                add 1 to {sw.arenas.menu}
                            else:
                                format slot {sw.arenas.menu} of player with green clay named "&8 " with lore "&7Name&8: &e&l%loop-value%||&7Status&8: %{sw.arena.%loop-value%.status}%||&7Players&8: &7%{sw.arena.%loop-value%.playing}%/%{sw.arena.%loop-value%.max}%||||&a&oClick to join!" to close then run [make player execute command "sw join %loop-value%"]                                                 
                                add 1 to {sw.arenas.menu}
                        set {sw.arenas.menu} to 0
                        stop



every time is joining same arena even i click to another

Skquery format slot bugs alot use tuske format gui slot

http://skunity.com/search?search=Make+GUI#
 
huh, i don't want more addons./:

:emoji_frowning: well these are well known bugs of skquery

you can try 1 thing:

code_language.skript:
if size of {sw.arenas::*} is not 0:
                    send "&7Loading arenas..."
                    set {sw.arenas.menu} to 0
                    if size of {sw.arenas::*} <= 9:
                        open chest with 1 row named "SKYWARS ARENAS" to player
                        wait 1 tick
                        loop {sw.arenas::*}:
                            if {sw.arena.%loop-value%.status} is "{@ingame}":
                                format slot {sw.arenas.menu} of player with red clay named "&8 " with lore "&7Name&8: &e&l%loop-value%||&7Status&8: %{sw.arena.%loop-value%.status}%||&7Players&8: &7%{sw.arena.%loop-value%.playing}%/%{sw.arena.%loop-value%.max}%||||&a&oClick to join!" to close then run [make player execute command "sw join %loop-value%"]
                                add 1 to {sw.arenas.menu}
                            else:
                                format slot {sw.arenas.menu} of player with green clay named "&8 " with lore "&7Name&8: &e&l%loop-value%||&7Status&8: %{sw.arena.%loop-value%.status}%||&7Players&8: &7%{sw.arena.%loop-value%.playing}%/%{sw.arena.%loop-value%.max}%||||&a&oClick to join!" to close then run [make player execute command "sw join %loop-value%"]                                                 
                                add 1 to {sw.arenas.menu}
                        set {sw.arenas.menu} to 0
                        stop
 

you can try this not tested

code_language.skript:
if size of {sw.arenas::*} is not 0:
    send "&7Loading arenas..."
    set {sw.arenas.menu} to 0
    if size of {sw.arenas::*} <= 9:
        open chest with 1 row named "SKYWARS ARENAS" to player
        wait 1 tick
        loop {sw.arenas::*}:
            if {sw.arena.%loop-value%.status} is "{@ingame}":
                set slot {sw.arenas.menu} of player's current inventory to red clay named "&8 " with lore "&7Name&8: &e&l%loop-value%||&7Status&8: %{sw.arena.%loop-value%.status}%||&7Players&8: &7%{sw.arena.%loop-value%.playing}%/%{sw.arena.%loop-value%.max}%||||&a&oClick to join!"
                add 1 to {sw.arenas.menu}
            else:
                set slot {sw.arenas.menu} of player's current inventory to green clay named "&8 " with lore "&7Name&8: &e&l%loop-value%||&7Status&8: %{sw.arena.%loop-value%.status}%||&7Players&8: &7%{sw.arena.%loop-value%.playing}%/%{sw.arena.%loop-value%.max}%||||&a&oClick to join!"                                                 
                add 1 to {sw.arenas.menu}
        set {sw.arenas.menu} to 0
        stop

on inventory click:
    inventory name of player's current inventory contains "SKYWARS ARENAS"
    cancel event
    if "%clicked inventory%" is "CHEST":
        if clicked item is red clay or green clay:
            set {_arena} to line 1 of lore of clicked item
            replace every "&7Name&8: &e&l" with "" in {_arena}
            make player execute command "sw join %{_arena}%"
 
Status
Not open for further replies.