Color bugg with Skelett 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.

Brok3nmind

Active Member
Feb 3, 2017
66
1
8
22
Germany
darkvoid.eu
I have a problem with the colors in Skelett Scoreboards.
Sometimes colors will not show correctly.
Sometimes the half variable will be shown correct and the other half not.

Bugg Image Photo:
https://darkvoid.eu/Bugg.PNG

Code:
on disconnect:
    deleteBoard(player, "Survival")

function createBoard(p: player, t: text, size: integer = 12):
    add "&a", "&b", "&c", "&d", "&e", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9" and "&f" to {_d::*}
    if stylish scoreboard "%{_t}%-%{_p}%" does not exist:
        create new stylish scoreboard named "%{_t}%-%{_p}%"
        loop {_size} times:
            create a new id based score "%{_p}%Slot%loop-number%" with text "%{_d::%loop-number%}%" slot loop-number for stylish scoreboard "%{_t}%-%{_p}%"

function deleteBoard(p: player, t: text):
    loop 12 times:
        delete the id based score "%{_p}%Slot%loop-number%" in stylish scoreboard "%{_t}%-%{_p}%"
    delete stylish scoreboard "%{_t}%-%{_p}%"

function setSlot(p: player, board: text, slot: integer, t: text):
    add "&a", "&b", "&c", "&d", "&e", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9" and "&f" to {_d::*}
    if {_slot} is between 1 and 12:
        set text of id "%{_p}%Slot%{_slot}%" to "%{_d::%{_slot}%}%%{_t}%"
        
on join:
    createBoard(player, "Survival", 12)
    set title of stylish scoreboard "Survival-%player%" to " &7-&8/&7- &3Darkvoid-Network &7-&8/&7- "
    set stylish scoreboard of player to "Survival-%player%"
    if {player.kills::%event-player%} is not set:
        set {player.kills::%event-player%} to 0
    if {mob.kills::%event-player%} is not set:
        set {mob.kills::%event-player%} to 0
    if {player.deaths::%event-player%} is not set:
        set {player.deaths::%event-player%} to 0
    updateBoard(player)
        
function updateBoard(p: player):
    set {_t} to total xp of {_p}
    set {_uuid} to uuid of {_p}
    set title of stylish scoreboard "Survival-%{_p}%" to " &7-&8/&7-  &eSurvival  &7-&8/&7- "
    set stylish scoreboard of {_p} to "Survival-%{_p}%"
    setSlot({_p}, "Survival", 12, "&fCurrent World:")
    if {_p} is in world "world":
        setSlot({_p}, "Survival", 11, "&aMainWorld")
    if {_p} is in world "farmingworld":
        setSlot({_p}, "Survival", 11, "&aFarmworld &aOverworld")
    if {_p} is in world "farmingnether":
        setSlot({_p}, "Survival", 11, "&aMainWorld")
    if {_p} is in world "farmingnend":
        setSlot({_p}, "Survival", 11, "&aMainWorld")
    if {_p} is in world "farmingnend":
        setSlot({_p}, "Survival", 11, "&aMainWorld")
    
    setSlot({_p}, "Survival", 10, "")
    set the text of id "%{_p}%Slot9" to "&fLevel: &c%{_t}%&7❖"
    setSlot({_p}, "Survival", 8, "")
    set the text of id "%{_p}%Slot7" to "Coins: &2%{money.%{_uuid}%}%"
    setSlot({_p}, "Survival", 6, "")
    set the text of id "%{_p}%Slot5" to "Player Kills: &a%{player.kills::%{_p}%}%"
    set the text of id "%{_p}%Slot4" to "Mob Kills: &a%{mob.kills::%{_p}%}%"
    set the text of id "%{_p}%Slot3" to "Deaths: &a%{player.deaths::%{_p}%}%"
    setSlot({_p}, "Survival", 2, "")
    setSlot({_p}, "Survival", 1, "&ewww.darkvoid&e.eu")
    
every 3 ticks:
    loop all players:
        updateBoard(loop-player)
        
on death:
    if attacker is a player:
        if event-entity is a monster:
            add 1 to {mob.kills::%attacker%}
            updateBoard(event-player)
            stop
        if event-entity is a player:
            add 1 to {player.kills::%attacker%}
            add 1 to {player.deaths::%victim%}
            updateBoard(event-player)
            stop
 
Status
Not open for further replies.