Im stuck with making a leaderboard with kills and deaths

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

Twinblocker

New Member
May 30, 2020
7
0
1
23
Please help me make a leaderboard with kills and deaths and coins

this is my 1st thread lol


every 0.1 second:
loop all players:
wipe loop-player's sidebar
set name of sidebar of loop-player to "&8>> &cFighting Simulator &8<<"
set score "&7" in sidebar of loop-player to 15
set score "&cDeaths: " in sidebar of loop-player to 14
set score "&cKills: " in sidebar if loop-player to 12
 
You need variables such as {kills::%player%}, {deaths::%player%} or something else
Code:
on join:
    if {kills::%player%} and {deaths::%player%} are not set:
        set {kills::%player%} to 0
        set {deaths::%player%} to 0

on death of a player:
    set death message to ""
    if attacker is a player:
        add 1 to {kills::%attacker%}
        add 1 to {deaths::%player%}
        broadcast "&c%player% &7was slain by &a%attacker%&7."

Code:
set score "&cDeaths: &f%{deaths::%loop-player%}% " in sidebar of loop-player to 14
set score "&cKills: &f%{kills::%loop-player%}% " in sidebar of loop-player to 12

For leaderboards, I recomment u to use https://forums.skunity.com/resources/mirrorutils.706/, you need skript-mirror
Code:
command /topkills:
    trigger:
        set {_topkills::*} to 10 values of {kills::*} as "&f##<pos>. &6<index> &7- <value> kills"
        send "&7&m-------------------------"
        send "&a&lKills | Top 10"
        loop {_topkills::*}:
            message loop-value
        send "&7&m-------------------------"
        stop
command /topdeaths:
    trigger:
        set {_topdeaths::*} to 10 values of {deaths::*} as "&f##<pos>. &6<index> &7- <value> kills"
        send "&7&m-------------------------"
        send "&c&lDeaths | Top 10"
        loop {_topdeaths::*}:
            message loop-value
        send "&7&m-------------------------"
        stop
 
Status
Not open for further replies.