1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved How to replace <none> with 0?

Discussion in 'Requests' started by SpinKnight, Jan 25, 2018.

Tags:
  1. SpinKnight

    Supporter + Supporter

    Joined:
    May 24, 2017
    Messages:
    30
    Likes Received:
    0
    Code (Skript):
    1. command /score [<Offline player>]:
    2.     Trigger:
    3.         If arg-1 is not set:
    4.             Display board named "&3 &3 &b&lSpin&c&lFactions&3 &3" to player
    5.             Make score of "&1" in board of player to 10
    6.             Make score of "&aOnline:" in board of player to 9
    7.             Make score of "&3%number of all players%&a/&350" in board of player to 8
    8.             Make score of "&2" in board of player to 7
    9.             Make score of "&aPenge:" in board of player to 6
    10.             Make score of "&3%player's balance%" in board of player to 5
    11.             Make score of "&4" in board of player to 4
    12.             Make score of "&aKills:" in board of player to 3
    13.             Make score of "&3%{kills.%player%}%" in board of player to 2
    14.             Move display of player to sidebar
    15.        
    16. On join:
    17.     make player execute command "score"
    18.    
    19. On first join:
    20.     make player execute command "score"
    21.    
    22. Every 5 seconds:
    23.     make all players execute command "score"
    24.    
    25. On death of a player:
    26.     if attacker is a player:
    27.         add 1 to {kills.%player%}
    Hello,

    I was wondering if anyone could help me with my "Kills" on my scoreboard. I want it to say 0 when you have no kills, but instead it says "<none>". Anyone know if you can fix that? I'd really appreciate the help!
     
  2. White

    White Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    445
    Likes Received:
    25
    Check if the variable is not set, then set it to 0.
     
  3. BrettPlayMC

    Supporter

    Joined:
    Jan 26, 2017
    Messages:
    715
    Likes Received:
    53
    Or check if it is none when displaying it and if it is, set the line to a line that contains 0. Then use “else:” and use the actual variable.
     
  4. Snow-Pyon

    Snow-Pyon Well-Known Member

    Joined:
    Jan 25, 2017
    Messages:
    1,235
    Likes Received:
    176
    Medals:
    If you have skQuery, you can do:
    Code (Skript):
    1. send "whatever: %{my-var} ? 0%"
     

Share This Page

Loading...