ID based Scoreboard

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

Allesco

New Member
Feb 2, 2018
6
0
0
21
Germany, Lower Saxony
Hello Skunity Community,
I have a pvp server with a system which uses scoreboards for stats.
I used this code so far:


code_language.skript:
on join:
    while player is online:
        wait 1 ticks
        wipe player's sidebar
        set name of sidebar of player to "&8● &fKBFFA &8●"
        set score "&a" in sidebar of player to 13
        set score "&7Kills/Tode" in sidebar of player to 12
        set score "&8» &a%{kills.%player%}% &8┃ &c%{deaths.%player%}%" in sidebar of player to 11
        set score "&b" in sidebar of player to 10
        set score "&7Coins" in sidebar of player to 9
        set score "&8» &e%{geld.%player%}% " in sidebar of player to 8
        set score "&c" in sidebar of player to 7
        set score "&7Map" in sidebar of player to 6
        set score "&8» &e%{map}%" in sidebar of player to 5
        set score "&e" in sidebar of player to 4
        set score "&7Kit" in sidebar of player to 3
        set score "&8» &e%{kit.%player%}%" in sidebar of player to 2
        set score "&f" in sidebar of player to 1
        Wait 5 seconds

But now I want to update the lines on items like "on death".
Now how the code looks:


code_language.skript:
on join:
    while player is online:
        wait 1 ticks
        wipe player's sidebar
        set name of sidebar of player to "&8● &fKBFFA &8●"
        set id based score "&a" in sidebar of player to 13 with id "13"
        set id based score "&7Kills/Tode" in sidebar of player to 12 with id "12"
        set id based score "&8» &a%{kills.%player%}% &8┃ &c%{deaths.%player%}%" in sidebar of player to 11 with id "11"
        set id based score "&b" in sidebar of player to 10 with id "10"
        set id based score "&7Coins" in sidebar of player to 9 with id "9"
        set id based score "&8» &e%{geld.%player%}% " in sidebar of player to 8 with id "8"
        set id based score "&c" in sidebar of player to 7 with id "7"
        set id based score "&7Map" in sidebar of player to 6 with id "6"
        set id based score "&8» &e%{map}%" in sidebar of player to 5 with id "5"
        set id based score "&e" in sidebar of player to 4 with id "4"
        set id based score "&7Kit" in sidebar of player to 3 with id "3"
        set id based score "&8» &e%{kit.%player%}%" in sidebar of player to 2 with id "2"
        set id based score "&f" in sidebar of player to 1 with id "1"
        stop

Now I had set the id based lines.
But how I can do the updates?

I tried this:

code_language.skript:
on death:
    edit score id "11" to "&8» &a%{kills.%victim%}% &8┃ &c%{deaths.%victim%}%" and 11

Thank you for your help :emoji_wink:
regards,

Allesco | Timon
 
Hey,
small example on what I used back a while:

code_language.skript:
command /testcreate:
    trigger:
        create id based score " &7• &7Your current Level: &c" in sidebar of player to 15 with id "level.%player%"

then update it via:

code_language.skript:
every 1 second:
    loop all players:
        update score id "level.%loop-player%" to " &7• &7Your current Level: &c%{gungamelevel::%loop-player%}%" and 15


Of course, adapt it to your code and on death event, however use this way to create and update the lines :emoji_slight_smile:.

If someone got an better/more efficient way, feel free to post it ;D.
 
Status
Not open for further replies.