lemonteho

Make me a skript of death message for player only and make it in modern style for my boxpvp server

Kodari AI
KodariApr 3 at 12:55 pm 3,180 (v2)
BoxPVPDeathMessages
A modern and stylish death message system designed for BoxPVP servers. Replaces default Minecraft death messages with custom-formatted, visually appealing messages shown only to players (not in console). Features gradient-style formatting, weapon/cause detection, killer tracking, clean separator lines, and dynamic messages based on damage cause. Supports PvP kills, environmental deaths, and more with a sleek modern chat design.

✦ BoxPVP Death Messages

Place BoxPVPDeathMessages.sk in your plugins/Skript/scripts/ folder, then run /sk reload BoxPVPDeathMessages.


💀 Features

Feature
Details
PvP Kill Messages
10 random rotating messages with killer + weapon
Environmental Deaths
Custom messages for fall, fire, drown, explosion, poison
Death Title
Red title shown only to the player who died
Modern Style
Clean separator lines, color-coded, console-clean
Kill/Death Tracking
Persistent per-player stats stored in variables
Commands
/kills
,
/deaths
,
/kdr
,
/resetstats

🔧 Commands & Permissions

Command
Permission
Description
/kills [player]
boxpvp.kills
View kill count
/deaths [player]
boxpvp.deaths
View death count
/kdr [player]
boxpvp.kdr
View Kill/Death ratio
/resetstats <player>
boxpvp.admin
Reset a player’s stats
Kodari can make mistakes. Review important code before using.
Files
BoxPVPDeathMessages.sk
Code
1 157
BoxPVPDeathMessages.sk
options:
    prefix: &8[&c✦ Death&8]
    separator: &8&m-----------------------------
    pvp-color: &c
    env-color: &e
    title-color: &4

on script load:
    send "&8[&c✦ BoxPVP Death Messages&8] &aLoaded successfully!" to console

on death:
    if victim is a player:
        cancel event
        set {_victim} to victim's name
        set {_killer} to attacker

        if {_killer} is a player:
            set {_killerName} to {_killer}'s name
            set {_weapon} to {_killer}'s tool
            set {_weaponName} to "%{_weapon}%"

            replace all "_" with " " in {_weaponName}
            replace all "minecraft:" with "" in {_weaponName}

            set {_msg} to getRandomPvPMessage({_victim}, {_killerName}, {_weaponName})

            loop all players:
                send "" to loop-player
                send "{@separator}" to loop-player
                send "   {@pvp-color}☠ &7%{_msg}%" to loop-player
                send "{@separator}" to loop-player
                send "" to loop-player

            send title "&c☠ YOU DIED" with subtitle "&7Killed by &c%{_killerName}%" to victim for 3 seconds
        else:
            set {_cause} to victim's last damage cause
            set {_msg} to getRandomEnvMessage({_victim}, "%{_cause}%")

            loop all players:
                send "" to loop-player
                send "{@separator}" to loop-player
                send "   {@env-color}✦ &7%{_msg}%" to loop-player
                send "{@separator}" to loop-player
                send "" to loop-player

            send title "&e✦ YOU DIED" with subtitle "&7You met your end..." to victim for 3 seconds

        set {deathcount::%victim's uuid%} to {deathcount::%victim's uuid%} + 1
        set {killcount::%{_killer}'s uuid%} to {killcount::%{_killer}'s uuid%} + 1

function getRandomPvPMessage(victim: text, killer: text, weapon: text) :: text:
    set {_r} to a random integer between 1 and 10
    if {_r} is 1:
        return "%{_victim}% &7was &cdestroyed &7by &c%{_killer}% &8» &7%{_weapon}%"
    if {_r} is 2:
        return "%{_victim}% &7got &cclapped &7by &c%{_killer}% &8» &7%{_weapon}%"
    if {_r} is 3:
        return "&c%{_killer}% &7wiped out %{_victim}% &8» &7%{_weapon}%"
    if {_r} is 4:
        return "%{_victim}% &7was &cfinished &7by &c%{_killer}% &8» &7%{_weapon}%"
    if {_r} is 5:
        return "&c%{_killer}% &7eliminated %{_victim}% &8» &7%{_weapon}%"
    if {_r} is 6:
        return "%{_victim}% &7couldn't survive &c%{_killer}%'s &7wrath &8» &7%{_weapon}%"
    if {_r} is 7:
        return "&c%{_killer}% &7sent %{_victim}% &7to the void &8» &7%{_weapon}%"
    if {_r} is 8:
        return "%{_victim}% &7got &coutplayed &7by &c%{_killer}% &8» &7%{_weapon}%"
    if {_r} is 9:
        return "&c%{_killer}% &7ended %{_victim}%'s &7streak &8» &7%{_weapon}%"
    return "%{_victim}% &7was &cslain &7by &c%{_killer}% &8» &7%{_weapon}%"

function getRandomEnvMessage(victim: text, cause: text) :: text:
    if {_cause} contains "void" or {_cause} contains "fall":
        set {_r} to a random integer between 1 and 3
        if {_r} is 1:
            return "%{_victim}% &7thought they could fly"
        if {_r} is 2:
            return "%{_victim}% &7fell into the void"
        return "%{_victim}% &7forgot where the ground was"
    if {_cause} contains "fire" or {_cause} contains "lava" or {_cause} contains "burn":
        set {_r} to a random integer between 1 and 3
        if {_r} is 1:
            return "%{_victim}% &7didn't stop drop and roll"
        if {_r} is 2:
            return "%{_victim}% &7turned into a crispy treat"
        return "%{_victim}% &7got too close to the heat"
    if {_cause} contains "drown":
        set {_r} to a random integer between 1 and 2
        if {_r} is 1:
            return "%{_victim}% &7forgot how to breathe"
        return "%{_victim}% &7tried to breathe water"
    if {_cause} contains "explosion" or {_cause} contains "block_explosion":
        set {_r} to a random integer between 1 and 2
        if {_r} is 1:
            return "%{_victim}% &7went &cboom &7unexpectedly"
        return "%{_victim}% &7couldn't handle the explosion"
    if {_cause} contains "poison" or {_cause} contains "magic":
        return "%{_victim}% &7was taken down by dark forces"
    return "%{_victim}% &7met an unexpected end &8» &7%{_cause}%"

command /deaths [<player>]:
    permission: boxpvp.deaths
    trigger:
        if arg-1 is not set:
            set {_d} to {deathcount::%player's uuid%}
            if {_d} is not set:
                set {_d} to 0
            send "{@prefix} &7Your deaths: &c%{_d}%"
        else:
            set {_d} to {deathcount::%arg-1's uuid%}
            if {_d} is not set:
                set {_d} to 0
            send "{@prefix} &7%arg-1%'s deaths: &c%{_d}%"

command /kills [<player>]:
    permission: boxpvp.kills
    trigger:
        if arg-1 is not set:
            set {_k} to {killcount::%player's uuid%}
            if {_k} is not set:
                set {_k} to 0
            send "{@prefix} &7Your kills: &a%{_k}%"
        else:
            set {_k} to {killcount::%arg-1's uuid%}
            if {_k} is not set:
                set {_k} to 0
            send "{@prefix} &7%arg-1%'s kills: &a%{_k}%"

command /kdr [<player>]:
    permission: boxpvp.kdr
    trigger:
        if arg-1 is not set:
            set {_k} to {killcount::%player's uuid%}
            set {_d} to {deathcount::%player's uuid%}
            if {_k} is not set:
                set {_k} to 0
            if {_d} is not set:
                set {_d} to 1
            set {_ratio} to {_k} / {_d}
            send "{@prefix} &7Your KDR: &e%.2f%{_ratio}% &8| &aKills: &f%{_k}% &8| &cDeaths: &f%{_d}%"
        else:
            set {_k} to {killcount::%arg-1's uuid%}
            set {_d} to {deathcount::%arg-1's uuid%}
            if {_k} is not set:
                set {_k} to 0
            if {_d} is not set:
                set {_d} to 1
            set {_ratio} to {_k} / {_d}
            send "{@prefix} &7%arg-1%'s KDR: &e%.2f%{_ratio}% &8| &aKills: &f%{_k}% &8| &cDeaths: &f%{_d}%"

command /resetstats <player>:
    permission: boxpvp.admin
    trigger:
        delete {killcount::%arg-1's uuid%}
        delete {deathcount::%arg-1's uuid%}
        send "{@prefix} &aReset stats for &f%arg-1%"