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

Astyll

Member
Jul 19, 2023
1
0
1
20
hi, im having problems with my scoreboard its buggy and glitching out. Can someone help me with this?
my code is this:
code_language.skript:
every 1 second:
    loop all players:
        set {_online} to number of all players
        set name of sidebar of loop-players to "&6&l&n&e&l&nG&6&l&nradeUpWards"
        wait 4 tick
        set name of sidebar of loop-players to "&6&l&nG&e&l&nr&6&l&nadeUpWards"
        wait 4 tick
        set name of sidebar of loop-players to "&6&l&nGr&e&l&na&6&l&ndeUpWards"
        wait 4 tick
        set name of sidebar of loop-players to "&6&l&nGra&e&l&nd&6&l&neUpWards"
        wait 4 tick
        set name of sidebar of loop-players to "&6&l&nGrad&e&l&ne&6&l&nUpWards"
        wait 4 tick
        set name of sidebar of loop-players to "&6&l&nGrade&e&l&nU&6&l&npWards"
        wait 4 tick
        set name of sidebar of loop-players to "&6&l&nGradeU&e&l&np&6&l&nWards"
        wait 4 tick
        set name of sidebar of loop-players to "&6&l&nGradeUp&e&l&nW&6&l&nards"
        wait 4 tick
        set name of sidebar of loop-players to "&6&l&nGradeUpW&e&l&na&6&l&nrds"
        wait 4 tick
        set name of sidebar of loop-players to "&6&l&nGradeUpWa&e&l&nr&6&l&nds"
        wait 4 tick
        set name of sidebar of loop-players to "&6&l&nGradeUpWar&e&l&nd&6&l&ns"
        wait 4 tick
        set name of sidebar of loop-players to "&6&l&nGradeUpWard&e&l&ns&6&l&n"
        wait 4 tick
        set score "&7 " in sidebar of loop-players to 9
        set score "&6  Online Players: &a&l%{_online}%" in sidebar of loop-players to 8
        set score "&7  " in sidebar of loop-players to 7
        set score "&7&e&lSTATS" in sidebar of loop-players to 6
        set score "&6 » &d⛏&f &dError" in sidebar of loop-players to 5
        set score "&6 » &4⚔&f &4Error" in sidebar of loop-players to 4
        set score "&6 » &5☠&f &5Error" in sidebar of loop-players to 3
        set score "&6 » &a❤&f &aError" in sidebar of loop-players to 2
        set score "&6 » &b⌚&f &bError" in sidebar of loop-players to 1
        set score "&6 " in sidebar of loop-players to 0

I'll leave the stats for what it is now, im the most sad about the scoreboards name cuz its going random. and the online players adds a new line everytime a player joins..
i've tried several ways to fix this but it doesnt work, can someone help me?
Also i have very little experience with skript so please explain what i did wrong :emoji_slight_smile:
 
One thing to note is that looping something using Skript is not recommend as it can cause lag and performance issues in general. What you instead can do is only change the scoreboard when it needs to be changed (Ie: Player buys an item, update the scoreboard, player sells item, update it, etc). To do this you should use a function. Something you could also do instead of that which isn't really the best solution is looping it every tick. 1 tick is far less than a second but for the reason I stated in the beginning; it's not a good idea. It's better to change/show it when it needs to be updated.