Solved Why does it show <none> ?

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

LoneElf

Active Member
Apr 30, 2017
165
2
18
Hi. So I have this code:
code_language.skript:
        if size of all bungeecord players on server "Prisons" is 0:
            format slot 15 of player with an 101 named "&8» &7&lPrisons &8«" with lore "&8&m-|------------------------|-&r   ||&8» &7Escape the Prison you||&8» &7have been placed||&8» &7in by mining for money||&8» &7which can be used||&8» &7to escape into freedom!||&8&m-|------------------------|-|| &8* &7Online: &a0" to close then run "Prisons %player%"
        else:
            format slot 15 of player with an 101 named "&8» &7&lPrisons &8«" with lore "&8&m-|------------------------|-&r   ||&8» &7Escape the Prison you||&8» &7have been placed||&8» &7in by mining for money||&8» &7which can be used||&8» &7to escape into freedom!||&8&m-|------------------------|-|| &8* &7Online: &a%{_numPrisons}%" to close then run "Prisons %player%"
code_language.skript:
every second in "world":
      set {_numPrisons} to number of all bungeecord players on server "Prisons"

So, when there are 0 players on prisons, it works fine, but when there is a player on, it says <none>. Please help me! Thanks :emoji_slight_smile:
 
Not related to your issue, but don't use format slot for GUIs. Please use TuSKe's GUI Manager instead. Tutorial here.
 
Thanks for the suggestion, but format slot has been working fine for me, so if you could explain why I should switch and learn new syntax, then I might switch to TuSKe
 
Oh I see the issue, alright so you are using a local variable, which who knows, if they are in the same chunk of code, its fine however Im betting its two different parts of code, so instead of {_numPrisons} just do {numPrisons}, that OR you could just instead do
code_language.skript:
        if size of all bungeecord players on server "Prisons" is 0:
            format slot 15 of player with an 101 named "&8» &7&lPrisons &8«" with lore "&8&m-|------------------------|-&r   ||&8» &7Escape the Prison you||&8» &7have been placed||&8» &7in by mining for money||&8» &7which can be used||&8» &7to escape into freedom!||&8&m-|------------------------|-|| &8* &7Online: &a0" to close then run "Prisons %player%"
        else:
            set {_numPrisons} to number of all bungeecord players on server "Prisons"
            format slot 15 of player with an 101 named "&8» &7&lPrisons &8«" with lore "&8&m-|------------------------|-&r   ||&8» &7Escape the Prison you||&8» &7have been placed||&8» &7in by mining for money||&8» &7which can be used||&8» &7to escape into freedom!||&8&m-|------------------------|-|| &8* &7Online: &a%{_numPrisons}%" to close then run "Prisons %player%"
 
Status
Not open for further replies.