Jump to content

Skymine server needs a scoreboard (sidebar)


Skray

Recommended Posts

I need help with a scoreboard, I have skript and SkRayFall.

Ranks I am using Permission Ex, essentials.

Look:

 

&b--------------------------------

Name: <player's name>

Rank: <rank>

Mined blocks: <mined blocks>

Kills: <kills>

Deaths: <deaths>

&b--------------------------------

I also need help with something like:

on kill:
	add 1 to {deaths : :*}

but idk how to make that.

Please help!

Link to comment
Share on other sites

every 3 seconds:
    loop all players:
        wipe loop-player's sidebar
        set {_uuid} to loop-player's uuid
        set name of loop-player's sidebar to "&3&lServer"
        set score "&b----------------" in loop-player's sidebar to 7
        set score "&7Name: &f%loop-player's name%" in loop-player's sidebar to 6
        set score "&7Rank: &f%loop-player's group%" in loop-player's sidebar to 5
        set score "&7Mined Blocks: &f%{playerdata::%{_uuid}%::mined} ? 0%" in loop-player's sidebar to 4
        set score "&7Kills: &f%{playerdata::%{_uuid}%::kills} ? 0%" in loop-player's sidebar to 3
        set score "&7Deaths: &f%{playerdata::%{_uuid}%::deaths} ? 0%" in loop-player's sidebar to 2
        set score "&b----------------" in loop-player's sidebar to 1

on death of player:
    set {_v} to victim's uuid
    set {_a} to attacker's uuid
    add 1 to {playerdata::%{_v}%::deaths}
    add 1 to {playerdata::%{_a}%::kills} if {_a} is set

on break:
    set {_uuid} to player's uuid
    add 1 to {playerdata::%{_uuid}%::mined}

Untested. Also, you need Vault plugin for player's rank to show up.

There you go. 🙂

Edited by CoolProgrammer

Hello there! If you're reading this, hope you're having a wonderful day!

 

Feel free to contact me via Discord (CoolProgrammer#1920) for any help.

My DMs are always open for help.

You can also message via. forum messages for help.

1604908226_ScreenShot2021-01-28at10_32_28AM.png.2646ad6be239a9d0756a99e8e15602ab.png

Also, don't hesitate to leave a like on my post if I helped you in any way.

Link to comment
Share on other sites

Thank you so much! Do I need a thing like that for kills too? ↓ Also do you know how to add play time into the scoreboard?

on death of player:
    set {_v} to victim's uuid
    set {_a} to attacker's uuid
    add 1 to {playerdata::%{_v}%::deaths}
    add 1 to {playerdata::%{_a}%::kills} if {_a} is set
Link to comment
Share on other sites

6 hours ago, Skray said:

Thank you so much! Do I need a thing like that for kills too? ↓ Also do you know how to add play time into the scoreboard?


on death of player:
    set {_v} to victim's uuid
    set {_a} to attacker's uuid
    add 1 to {playerdata::%{_v}%::deaths}
    add 1 to {playerdata::%{_a}%::kills} if {_a} is set

Of course!

This is the way you do it:

# There is a better way of doing this, but this will work for now:
on first join:
    set {playerdata::%{_uuid}%::playtime} to 0 seconds

every 1 minute:
    loop all players:
        add 1 minute to {playerdata::%loop-player's uuid%::playtime}

 

And here is the final code:

every 3 seconds:
    loop all players:
        wipe loop-player's sidebar
        set {_uuid} to loop-player's uuid
        set name of loop-player's sidebar to "&3&lServer"
        set score "&b----------------" in loop-player's sidebar to 8
        set score "&7Name: &f%loop-player%" in loop-player's sidebar to 7
        set score "&7Rank: &f%loop-player's group%" in loop-player's sidebar to 6
        set score "&7Mined Blocks: &f%{playerdata::%{_uuid}%::mined} ? 0%" in loop-player's sidebar to 5
        set score "&7Kills: &f%{playerdata::%{_uuid}%::kills} ? 0%" in loop-player's sidebar to 4
        set score "&7Deaths: &f%{playerdata::%{_uuid}%::deaths} ? 0%" in loop-player's sidebar to 3
        set score "&7Playtime: &f%{playerdata::%{_uuid}%::playtime}%" in loop-player's sidebar to 2
        set score "&b----------------" in loop-player's sidebar to 1

on death of player:
    set {_v} to victim's uuid
    set {_a} to attacker's uuid
    add 1 to {playerdata::%{_v}%::deaths}
    add 1 to {playerdata::%{_a}%::kills} if {_a} is set

on break:
    set {_uuid} to player's uuid
    add 1 to {playerdata::%{_uuid}%::mined}

on first join:
    set {playerdata::%{_uuid}%::playtime} to 0 seconds

every 1 minute:
    loop all players:
        add 1 minute to {playerdata::%loop-player's uuid%::playtime}

Again, note that it's untested, and I expect you to read and go though this code to find how it works. 🙂

Happy learning!

Hello there! If you're reading this, hope you're having a wonderful day!

 

Feel free to contact me via Discord (CoolProgrammer#1920) for any help.

My DMs are always open for help.

You can also message via. forum messages for help.

1604908226_ScreenShot2021-01-28at10_32_28AM.png.2646ad6be239a9d0756a99e8e15602ab.png

Also, don't hesitate to leave a like on my post if I helped you in any way.

Link to comment
Share on other sites

On 1/27/2021 at 10:55 AM, CoolProgrammer said:

Of course!

This is the way you do it:


# There is a better way of doing this, but this will work for now:
on first join:
    set {playerdata::%{_uuid}%::playtime} to 0 seconds

every 1 minute:
    loop all players:
        add 1 minute to {playerdata::%loop-player's uuid%::playtime}

 

And here is the final code:


every 3 seconds:
    loop all players:
        wipe loop-player's sidebar
        set {_uuid} to loop-player's uuid
        set name of loop-player's sidebar to "&3&lServer"
        set score "&b----------------" in loop-player's sidebar to 8
        set score "&7Name: &f%loop-player%" in loop-player's sidebar to 7
        set score "&7Rank: &f%loop-player's group%" in loop-player's sidebar to 6
        set score "&7Mined Blocks: &f%{playerdata::%{_uuid}%::mined} ? 0%" in loop-player's sidebar to 5
        set score "&7Kills: &f%{playerdata::%{_uuid}%::kills} ? 0%" in loop-player's sidebar to 4
        set score "&7Deaths: &f%{playerdata::%{_uuid}%::deaths} ? 0%" in loop-player's sidebar to 3
        set score "&7Playtime: &f%{playerdata::%{_uuid}%::playtime}%" in loop-player's sidebar to 2
        set score "&b----------------" in loop-player's sidebar to 1

on death of player:
    set {_v} to victim's uuid
    set {_a} to attacker's uuid
    add 1 to {playerdata::%{_v}%::deaths}
    add 1 to {playerdata::%{_a}%::kills} if {_a} is set

on break:
    set {_uuid} to player's uuid
    add 1 to {playerdata::%{_uuid}%::mined}

on first join:
    set {playerdata::%{_uuid}%::playtime} to 0 seconds

every 1 minute:
    loop all players:
        add 1 minute to {playerdata::%loop-player's uuid%::playtime}

Again, note that it's untested, and I expect you to read and go though this code to find how it works. 🙂

Happy learning!

hey can u code me a scoreboard with generator cap beside it

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...