Solved Freeze Player On Death

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

ItsMCB

Member
May 20, 2018
46
1
8
23
www.vexel.media
I'm working on a skript where when a player dies, they would "freeze" for to seconds. I don't know why this isn't working, please tell me if you have any suggestions of fixing this, thanks.
code_language.skript:
on damage of player:
    if damage > victim's health:
        cancel event
        send victim title "&cYOU DIED!" with subtitle "&7Respawning in 5 seconds§7!" for 5 seconds
        set victim's gamemode to spectator
        set {_location} to location of victim
        set {_x} to x-coords of victim
        set {_z} to z-coords of victim
        loop 1000 times:
            set {_x-check} to x-coords of victim
            set {_z-check} to z-coords of victim
            if {_x-check} isn't {_x}:
                teleport victim to {_location}
            if {_z-check} isn't {_z}:
                teleport victim to {_location}
        wait 5 seconds
        set victim's gamemode to survival
        set victim's health to 10
 
Status
Not open for further replies.