List command bug,error /list skript

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

AkroDogy2005

Member
Apr 20, 2018
18
1
3
24
Hey i have this skript:
code_language.skript:
command /list:
    aliases: /who
    trigger:
        if player is op:
            message "&7>&8&l&m--------------------------------------&7<"
            message ""
            set {_amountplayers} to amount of players
            message "&8&7(&e!&7) &fOnline players: &e%{_amountplayers}%&f/&e200"
            loop all players:
                if loop-player has permission "akrolist.staff":
                    add loop-player to {_online staff::*}
                    message "&8&7(&e!&7) &fStaff: &e%{_online staff::*}%"
                if loop-player has permission "akrolist.donor":
                    add loop-player to {_online donor::*}
                    message "&8&7(&e!&7) &fDonors: &e%{_online donor::*}%"
            message ""
            message "&7>&8&l&m--------------------------------------&7<"

All it's good with 1 player (Proof» http://prntscr.com/m1vn1i)
But with 2 player i have this bug (Proof» http://prntscr.com/m1vn6x)

1. If isn't staff/donors online, in console it's disapear Staff and Donor lines, how can i resolve this? ( Proof» http://prntscr.com/m1vnr7)
2. How can i make a command which to make more lines: ex: I want donor line, staff line, and noob line without to open the skript file and edit.
Online players: 0
Staff: 0
Donors: 0
Noobs: AkroDogy (if the player has permission using a command to set it ex:akrolist.noob ingame: /setpermision noobs akrolist.noob)
3. If isn't staff/donors online, how can i do in /list command to be Staff: 0,Donor: 0?
 
You should message after the loop
 
No im not going to spoonfeed you. just move the message "online donor stuff" to somewhere after the loop
 
what part of it dont you understand
 
i did something, but donors and staff leave the game, in console disapear staff and donor line proof:http://prntscr.com/m1xmnx
New code
code_language.skript:
command /list:
    aliases: /who
    trigger:
        if player is op:
            message "&7>&8&l&m--------------------------------------&7<"
            message ""
            set {_amountplayers} to amount of players
            message "&8&7(&e!&7) &fOnline players: &e%{_amountplayers}%&f/&e200"
            loop all players:
                if loop-player has permission "akrolist.staff":
                    add loop-player to {_online staff::*}
                    if size of {_online staff::*} = 0:
                        set {_online staff::*} to 0
                if loop-player has permission "akrolist.donor":
                    add loop-player to {_online donor::*}
                    if size of {_online donor::*} = 0:
                        set {_online donor::*} to 0
            message "&8» &fStaff: &e%{_online staff::*}%"
            message "&8» &fDonors: &e%{_online donor::*}%"
            message ""
            message "&7>&8&l&m--------------------------------------&7<"
 
Last edited:
Status
Not open for further replies.