Kill by void

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

    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.

zaved

Member
Sep 19, 2022
18
0
1
Hey!

i already got much help here, thats why I wanna further post questions here :emoji_grinning:

So: I have a SkyPvP Server and I tested it a bit and found something that is annoying. Everytime that Im fighting with someone and I kick him off the island for example, he dies in the void, but I dont get the kill then. Is it possible to make a skript that the last attacker or the last hit or something gets the kill?

Greets
Sascha :emoji_slight_smile:
 
Uhhhhhhhhhhhhhhh pain
i can try
[doublepost=1666694604,1666693501][/doublepost]That should to it :emoji_grinning::emoji_slight_smile::emoji_slight_smile::emoji_slight_smile::emoji_slight_smile::emoji_slight_smile::emoji_slight_smile::emoji_grinning::emoji_grinning::emoji_grinning::emoji_grinning::emoji_grinning::emoji_grinning: (bruh)

Code:
# Your death function (teleports to spawn, bla bla)
function death(victim:player, attacker:player="<none>"):
    clear {_attacker} if {_attacker} is "<none>"
    if {_attacker} is set:
        broadcast "%{_victim}% was killed by %{_attacker}%"
    else:
        broadcast "%{_victim}% died :/"


on damage:
    attacker is online
    victim is online
    set metadata tag "lastattacker" of victim to attacker's uuid
    set metadata tag "lastattackertimer" of victim to unix timestamp of now

on death:
    set {_attacker} to (metadata tag "lastattacker" of victim) parsed as player
    {_attacker} is online

    set {_t} to metadata tag "lastattackertimer" of victim
    set {_n} to unix timestamp of now
    set {_d} to "%{_n} - {_t}%" parsed as number

    if {_d} is not more than 7: # Last attack not more than x seconds
        death(victim, {_attacker})
    else:
        death(victim)
 
Uhhhhhhhhhhhhhhh pain
i can try
[doublepost=1666694604,1666693501][/doublepost]That should to it :emoji_grinning::emoji_slight_smile::emoji_slight_smile::emoji_slight_smile::emoji_slight_smile::emoji_slight_smile::emoji_slight_smile::emoji_grinning::emoji_grinning::emoji_grinning::emoji_grinning::emoji_grinning::emoji_grinning: (bruh)

Code:
# Your death function (teleports to spawn, bla bla)
function death(victim:player, attacker:player="<none>"):
    clear {_attacker} if {_attacker} is "<none>"
    if {_attacker} is set:
        broadcast "%{_victim}% was killed by %{_attacker}%"
    else:
        broadcast "%{_victim}% died :/"


on damage:
    attacker is online
    victim is online
    set metadata tag "lastattacker" of victim to attacker's uuid
    set metadata tag "lastattackertimer" of victim to unix timestamp of now

on death:
    set {_attacker} to (metadata tag "lastattacker" of victim) parsed as player
    {_attacker} is online

    set {_t} to metadata tag "lastattackertimer" of victim
    set {_n} to unix timestamp of now
    set {_d} to "%{_n} - {_t}%" parsed as number

    if {_d} is not more than 7: # Last attack not more than x seconds
        death(victim, {_attacker})
    else:
        death(victim)

doesnt work :c
 
Status
Not open for further replies.