Scoreboard not working as intended

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

Scornn

Member
Feb 11, 2017
13
1
0
Skript Version:Skript 2.2
Skript Addons used: SkRayFall
Minecraft Version:1.8.8


Now I am having a little trouble with my script, It works in the way that It displays the scoreboard correctly, but its only showing 1 player's scoreboard to all the players, if that makes sense. I feel as if it is something to do with looping every one but I don't know how to fix it. There is no errors from reloading or in the console to my knowledge.

code_language.skript:
every 2 seconds:
    loop all players:
        wipe loop-player's sidebar
        make loop-player execute command "/score"
      

command /score:
    trigger:
#faction name
        set {_test} to the name of faction faction of factions player factions player player
        set name of sidebar of player to "&a&lPrimal&6&lCraft"
        set score "&6&l&m----------------" in sidebar of player to 6
        set score "&6&m------------------" in sidebar of player to 1
        set score "&aKills : %{kills.%player%}%" in sidebar of player to 4
        set score "&aOnline : %number of all players%" in sidebar of player to 5
        set score "&aDeaths : %{deaths.%player%}%" in sidebar of player to 3
        set score "&aFaction: &a%{_test}%" in sidebar of player to 2
        set score "&aprimalcrafteu.enjin.com" in sidebar of player to 0

If anyone needs any info to help me out, let me know and ill supply what I can.

Thank you!
 
Skript Version:Skript 2.2
Skript Addons used: SkRayFall
Minecraft Version:1.8.8


Now I am having a little trouble with my script, It works in the way that It displays the scoreboard correctly, but its only showing 1 player's scoreboard to all the players, if that makes sense. I feel as if it is something to do with looping every one but I don't know how to fix it. There is no errors from reloading or in the console to my knowledge.

code_language.skript:
[CODE=SKRIPT]every 2 seconds:
    loop all players:
        wipe loop-player's sidebar
#faction name
        set {_test} to the name of faction faction of factions loop-player factions loop-player loop-player
        set name of sidebar of loop-player to "&a&lPrimal&6&lCraft"
        set score "&6&l&m----------------" in sidebar of loop-player to 6
        set score "&6&m------------------" in sidebar of loop-player to 1
        set score "&aKills : %{kills.%player%}%" in sidebar of loop-player to 4
        set score "&aOnline : %number of all players%" in sidebar of loop-player to 5
        set score "&aDeaths : %{deaths.%loop-player %}%" in sidebar of loop-player to 3
        set score "&aFaction: &a%{_test}%" in sidebar of loop-player to 2
        set score "&aprimalcrafteu.enjin.com" in sidebar of loop-player to 0
[/CODE]

If anyone needs any info to help me out, let me know and ill supply what I can.

Thank you!

Loop the score without the command
 
Last edited by a moderator:
Sorry for the wait, I'm not quite sure what you mean could you possibly show me?
Think he means just remove the command part and just have it like this

code_language.skript:
every 2 second:
    loop all players:
        set {_test} to the name of faction faction of factions player factions player player
        wipe loop-player's sidebar
        set name of sidebar of player to "&a&lPrimal&6&lCraft"
        set score "&6&l&m----------------" in sidebar of player to 6
        set score "&6&m------------------" in sidebar of player to 1
        set score "&aKills : %{kills.%player%}%" in sidebar of player to 4
        set score "&aOnline : %number of all players%" in sidebar of player to 5
        set score "&aDeaths : %{deaths.%player%}%" in sidebar of player to 3
        set score "&aFaction: &a%{_test}%" in sidebar of player to 2
        set score "&aprimalcrafteu.enjin.com" in sidebar of player to 0
 
code_language.skript:
every 1 seconds
    loop all loop-players:
        set {_test} to the name of faction faction of factions loop-loop-player factions loop-player loop-player
        set name of sidebar of loop-player to "&a&lPrimal&6&lCraft"
        set score "&6&l&m----------------" in sidebar of loop-player to 6
        set score "&6&m------------------" in sidebar of loop-player to 1
        set score "&aKills : %{kills.%loop-player%}%" in sidebar of loop-player to 4
        set score "&aOnline : %number of all loop-players%" in sidebar of loop-player to 5
        set score "&aDeaths : %{deaths.%loop-player%}%" in sidebar of loop-player to 3
        set score "&aFaction: &a%{_test}%" in sidebar of loop-player to 2
        set score "&aprimalcrafteu.enjin.com" in sidebar of loop-player to 0
 
code_language.skript:
every 1 seconds
    loop all loop-players:
        set {_test} to the name of faction faction of factions loop-loop-player factions loop-player loop-player
        set name of sidebar of loop-player to "&a&lPrimal&6&lCraft"
        set score "&6&l&m----------------" in sidebar of loop-player to 6
        set score "&6&m------------------" in sidebar of loop-player to 1
        set score "&aKills : %{kills.%loop-player%}%" in sidebar of loop-player to 4
        set score "&aOnline : %number of all loop-players%" in sidebar of loop-player to 5
        set score "&aDeaths : %{deaths.%loop-player%}%" in sidebar of loop-player to 3
        set score "&aFaction: &a%{_test}%" in sidebar of loop-player to 2
        set score "&aprimalcrafteu.enjin.com" in sidebar of loop-player to 0
Exactly what I just did but yano
 
It's still doing the same thing, it's setting everyone's scoreboard to 1 player's scoreboard, I hope that makes sense.
[doublepost=1491080400,1491078459][/doublepost]I tried something different and got a different result, What keeps happening is the server is switching scoreboards between the player's doing the commands. So for example I do it, and it sets it to my info on the scoreboard, and the next player does it switching it to their scoreboard.


code_language.skript:
on join:
    make player execute command "/score"
   
   
command /score:
    trigger:
        set {_p} to player
        set {_mplayer} to factions player {_p}
        set {_faction} to faction of factions player {_mplayer}
        set {_name} to the name of faction {_faction}
        wipe player's sidebar
        set name of sidebar of player to "&a&lPrimal&6&lCraft"
        set score "&6&l&m----------------" in sidebar of player to 6
        set score "&6&m------------------" in sidebar of player to 1
        set score "&aKills : %{kills.%player%}%" in sidebar of player to 4
        set score "&aOnline : %number of all players%" in sidebar of player to 5
        set score "&aDeaths : %{deaths.%player%}%" in sidebar of player to 3
        set score "&aFaction: &a%{_name}%" in sidebar of player to 2
        set score "&aprimalcrafteu.enjin.com" in sidebar of player to 0
        wait 2 seconds
        make player execute command "/score"
 
code_language.skript:
every 2 second:
    loop all players:
        wipe loop-player's sidebar

And it's switching scoreboards because you're having more than 1 scoreboard go off
 
code_language.skript:
every 2 second:
    loop all players:
        wipe loop-player's sidebar

And it's switching scoreboards because you're having more than 1 scoreboard go off
How do I fix it then?
 
I literally just told you earlier that it wasn't working.

How would I make it update, as I previously said that it wasn't working if you read the full post above.

It's still doing the same thing, it's setting everyone's scoreboard to 1 player's scoreboard, I hope that makes sense.

code_language.skript:
every 2 second:
    loop all players:
        set {_p} to loop-player
        set {_mplayer} to factions player {_p}
        set {_faction} to faction of factions player {_mplayer}
        set {_name} to the name of faction {_faction}
        wipe loop-player's sidebar
        set name of sidebar of loop-player to "&a&lPrimal&6&lCraft"
        set score "&6&l&m----------------" in sidebar of loop-player to 6
        set score "&6&m------------------" in sidebar of loop-player to 1
        set score "&aKills : %{kills.%loop-player%}%" in sidebar of loop-player to 4
        set score "&aOnline : %number of all players%" in sidebar of loop-player to 5
        set score "&aDeaths : %{deaths.%loop-player%}%" in sidebar of loop-player to 3
        set score "&aFaction: &a%{_name}%" in sidebar of loop-player to 2
        set score "&aprimalcrafteu.enjin.com" in sidebar of loop-player to 0
 
Status
Not open for further replies.