Solved Completely avoid Death Screen

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

Vexio

Active Member
Jan 26, 2017
92
10
8
23
California
Hello!

So, some servers have a feature to when you die, it completely skips the death screen and puts you into a spectator mode. I've gotten a good portion of it done -- it works flawlessly, sometimes. Other times, it will lock the player on the death screen and them not being able to select "Respawn"; only "Quit to Title Screen".

I have some example videos of what I'm explaining here:
Death screen being avoided:

Death screen glitch:

Code:
code_language.skript:
on damage of player:
    wait 1 tick
    if victim's health is less than 0.5:
        heal the victim
        set the victim's gamemode to spectator
        add victim to {spec::*}
        send "&aYou are now spectating" to victim
        send "&aUse those damn items that don't exist right now!" to victim
 
I think the problem you may be having is when a player's health decreases in such a way, that it skips your if victim's health is less than 0.5 condition. This can be done if the killing attack brings the player's health from a number greater than 0.5, to 0. This can also happen if the previous attack brought the victim's health to 0.5, then the next attack brings it to 0.

Knowing this, we can edit your condition to satisfy these issues:
code_language.skript:
on damage of player:
    if (victim's health - damage) is less than 0.1:
        heal the victim
        set the victim's gamemode to spectator
        add victim to {spec::*}
        send "&aYou are now spectating" to victim
        send "&aUse those damn items that don't exist right now!" to victim

Basically, upon being damaged, we'll check if the damage dealt will bring the player to near death. It can't be exactly 0, or else the death screen will take over.
 
Hello!

So, some servers have a feature to when you die, it completely skips the death screen and puts you into a spectator mode. I've gotten a good portion of it done -- it works flawlessly, sometimes. Other times, it will lock the player on the death screen and them not being able to select "Respawn"; only "Quit to Title Screen".

I have some example videos of what I'm explaining here:
Death screen being avoided:

Death screen glitch:

Code:
code_language.skript:
on damage of player:
    wait 1 tick
    if victim's health is less than 0.5:
        heal the victim
        set the victim's gamemode to spectator
        add victim to {spec::*}
        send "&aYou are now spectating" to victim
        send "&aUse those damn items that don't exist right now!" to victim
It's rather simple, all they do is cancel the damage event if the damage event is enough to kill the victim. Using skellett you can do
code_language.skript:
if victim's health - final damage is less than or equal to 0:
 
You can use this, I can't test this i'm not in my house.
Edit: Is from RandomSK
code_language.skript:
on death of player:
        force respawn victim
 
You can use this, I can't test this i'm not in my house.
Edit: Is from RandomSK
code_language.skript:
on death of player:
        force respawn victim
I don't want the victim to be teleported to the spawnpoint. I want them to "as if they didn't die" kind of death
 
This??
code_language.skript:
on death of player:
    set {_loc} to location of victim
    force respawn victim
    teleport victim to {_loc}
 
Ohh sorry, my bad.
This? sorry if doesn't works, i'm not in my own house.
code_language.skript:
on death of player:
        cancel event
        heal the victim
        set the victim's gamemode to spectator
        add victim to {spec::*}
        send "&aYou are now spectating" to victim
        send "&aUse those damn items that don't exist right now!" to victim
 
Ohh sorry, my bad.
This? sorry if doesn't works, i'm not in my own house.
code_language.skript:
on death of player:
        cancel event
        heal the victim
        set the victim's gamemode to spectator
        add victim to {spec::*}
        send "&aYou are now spectating" to victim
        send "&aUse those damn items that don't exist right now!" to victim
You're not able to cancel the "on death" event sadly
 
Status
Not open for further replies.