Solved Scoreboard list variable problems

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

zetari

New Member
Aug 4, 2018
5
0
0
25
Skript Version: Skript 2.2 (dev25)
Skript Author: Bensku
Minecraft Version: 1.8.8 (spigot)

Full Code:
code_language.skript:
every 5 seconds:
    loop all players:
        wipe loop-player's sidebar
        set name of sidebar of loop-player to "&5&lArena"
        set score "&d&m«--------------------«" in sidebar of loop-player to 16
        set score "  &5Kills &7» %{ab::%uuid of loop-player%::kills}%" in sidebar of loop-player to 15
        set score "  &5Deaths &7» %{ab::%uuid of loop-player%::deaths}%" in sidebar of loop-player to 14
        set score "&d&m»--------------------»" in sidebar of loop-player to 11

on death of player:
    attacker is a player
    victim is a player
    add 1 to {ab::%uuid of attacker%::kills}
    add 1 to {ab::%uuid of victim%::deaths}

Errors on Reload: None.
Console Errors: N/A.

Addons:
  • RandomSK 2.0
  • Skellett 1.9.6b
  • SkQuery Lime 3.6.1-Lime
  • skRayFall 1.9.12
  • Umbaska 3

Troubleshooting:

Have you tried searching the docs? Yes.
Have you tried searching the forums? Yes.
What other methods have you tried to fix it?
I've tried other versions of Skript, such as the "2.2 Fixes V8" fork, aswell as the more updated (dev35) and outdated (Njol) versions. I've tried all three versions listed on the .down command in Discord, as well as not being able to find an answer there when asked. Tried different variable types, tried different scoreboard setups, different skRayFall versions; nothing works.

Problem:
The scoreboard shown in the code block works fine except for the list variables. These list variables do store the kills/deaths of the players with the UUIDs correctly. The problem is that when I try and use a loop for all players, it does load the kills, just not with separate scoreboards per player. The loop has it going for 5 seconds each, and in each rotation of 5 seconds, the scoreboard will cycle through all the kill/death variable values.
(ex. I brought two alts on the server [call them p1 and p2] and used p1 to kill p2 twice. The variable for kills stored the two kills under p1's uuid and the deaths under p2's uuid, just as told. Now, once this happened, the scoreboard would then refresh after 5 seconds, and both players would see the exact same board. The first one being p1's stats, 2 kills and 0 deaths, then refreshing to p2's stats, 0k 2d. Both players saw the same scoreboard. Mind that, this only happens when there is more than one player on the server at a time.)
I know per-player sb's are possible with skript, and I've been skripting for a long while to know that, but this truly stumped me, so I came here. Any help is appreciated. Thanks :emoji_slight_smile:
 
Skript Version: Skript 2.2 (dev25)
Skript Author: Bensku
Minecraft Version: 1.8.8 (spigot)

Full Code:
code_language.skript:
every 5 seconds:
    loop all players:
        wipe loop-player's sidebar
        set name of sidebar of loop-player to "&5&lArena"
        set score "&d&m«--------------------«" in sidebar of loop-player to 16
        set score "  &5Kills &7» %{ab::%uuid of loop-player%::kills}%" in sidebar of loop-player to 15
        set score "  &5Deaths &7» %{ab::%uuid of loop-player%::deaths}%" in sidebar of loop-player to 14
        set score "&d&m»--------------------»" in sidebar of loop-player to 11

on death of player:
    attacker is a player
    victim is a player
    add 1 to {ab::%uuid of attacker%::kills}
    add 1 to {ab::%uuid of victim%::deaths}

Errors on Reload: None.
Console Errors: N/A.

Addons:
  • RandomSK 2.0
  • Skellett 1.9.6b
  • SkQuery Lime 3.6.1-Lime
  • skRayFall 1.9.12
  • Umbaska 3

Troubleshooting:

Have you tried searching the docs? Yes.
Have you tried searching the forums? Yes.
What other methods have you tried to fix it?
I've tried other versions of Skript, such as the "2.2 Fixes V8" fork, aswell as the more updated (dev35) and outdated (Njol) versions. I've tried all three versions listed on the .down command in Discord, as well as not being able to find an answer there when asked. Tried different variable types, tried different scoreboard setups, different skRayFall versions; nothing works.

Problem:
The scoreboard shown in the code block works fine except for the list variables. These list variables do store the kills/deaths of the players with the UUIDs correctly. The problem is that when I try and use a loop for all players, it does load the kills, just not with separate scoreboards per player. The loop has it going for 5 seconds each, and in each rotation of 5 seconds, the scoreboard will cycle through all the kill/death variable values.
(ex. I brought two alts on the server [call them p1 and p2] and used p1 to kill p2 twice. The variable for kills stored the two kills under p1's uuid and the deaths under p2's uuid, just as told. Now, once this happened, the scoreboard would then refresh after 5 seconds, and both players would see the exact same board. The first one being p1's stats, 2 kills and 0 deaths, then refreshing to p2's stats, 0k 2d. Both players saw the same scoreboard. Mind that, this only happens when there is more than one player on the server at a time.)
I know per-player sb's are possible with skript, and I've been skripting for a long while to know that, but this truly stumped me, so I came here. Any help is appreciated. Thanks :emoji_slight_smile:
looking at your code, it SHOULD work. I dont see the issue. The only issue I see is Umbaska, that add-on wrecks everything. Try remove it from your server (and disable any scripts using it) and try it again.
 
looking at your code, it SHOULD work. I dont see the issue. The only issue I see is Umbaska, that add-on wrecks everything. Try remove it from your server (and disable any scripts using it) and try it again.

I really don't see the issue either.
Removed Umbaska, server loaded and I tried again with the variables. Didn't work, still the same problem. Tried resetting the variables file aswell. Still nothing.
 
Just for fun... try sithout uuids. Just player attached and victim. I have no idea how alts work but I wonder if there’s an issue there.
 
Just for fun... try sithout uuids. Just player attached and victim. I have no idea how alts work but I wonder if there’s an issue there.

Tried that too. Still no avail; I've tried without UUIDs, just names, specific characters in the names, etc.; I'm really stumped by it.
 
Hmmmm.... ok. I’m just out and about right now. I’ll be home in a few hours. If it’s not solved by then, then i’ll try see what I can figure out.
 
Okay, so I copied your code and tried it on my test server..It works perfectly fine. Albeit my server is a 1.12.2 server... but it means the code is done correctly. MY GUESS is it has something to do with SkRayFall... MAYBE try some older versions??

Another thing to do is in your config for SkRayFall, set this line to true (there's only two options in the config, its the first one)
enableFastScoreBoards: true

I have mine set to true.

Other than that, I dont know what else to say. Give those 2 things a try.
 
Try setting the kills and deaths variables to local variables, and then paste the local variables into the scoreboard
 
Try making a function that refreshes a specific player's scoreboard (with only the player variable given to the function). So something like this:
code_language.skript:
every 5 seconds:
    loop all players:
        refreshScoreboard(loop-player)
        
function refreshScoreboard(p: player):
    wipe {_p}'s sidebar
    set {_uuid} to uuid of {_p}
    set name of sidebar of {_p} to "&5&lArena"
    set score "&d&m«--------------------«" in sidebar of {_p} to 16
    set score "     &5Kills &7» %{ab::%{_uuid}%::kills}%" in sidebar of {_p} to 15
    set score "     &5Deaths &7» %{ab::%{_uuid}%::deaths}%" in sidebar of {_p} to 14
    set score "&d&m»--------------------»" in sidebar of {_p} to 11

on death of player:
    attacker is a player
    victim is a player
    add 1 to {ab::%uuid of attacker%::kills}
    add 1 to {ab::%uuid of victim%::deaths}
 
I've been away from my computer for the past days, and I just had time to look over these.

Okay, so I copied your code and tried it on my test server..It works perfectly fine. Albeit my server is a 1.12.2 server... but it means the code is done correctly. MY GUESS is it has something to do with SkRayFall... MAYBE try some older versions??

Another thing to do is in your config for SkRayFall, set this line to true (there's only two options in the config, its the first one)
enableFastScoreBoards: true

I have mine set to true.

Other than that, I dont know what else to say. Give those 2 things a try.

I just went in my config and noticed that enableFastScoreBoards was false, and I changed it to true and tried again. So far, this fix does work; and I thank everyone for the help given here.
 
Status
Not open for further replies.