1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Freeze Player On Death

Discussion in 'Skript' started by ItsMCB, Jun 3, 2018.

Tags:
Thread Status:
Not open for further replies.
  1. ItsMCB

    ItsMCB Member

    Joined:
    May 20, 2018
    Messages:
    46
    Likes Received:
    1
    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 (Skript):
    1. on damage of player:
    2.     if damage > victim's health:
    3.         cancel event
    4.         send victim title "&cYOU DIED!" with subtitle "&7Respawning in 5 seconds§7!" for 5 seconds
    5.         set victim's gamemode to spectator
    6.         set {_location} to location of victim
    7.         set {_x} to x-coords of victim
    8.         set {_z} to z-coords of victim
    9.         loop 1000 times:
    10.             set {_x-check} to x-coords of victim
    11.             set {_z-check} to z-coords of victim
    12.             if {_x-check} isn't {_x}:
    13.                 teleport victim to {_location}
    14.             if {_z-check} isn't {_z}:
    15.                 teleport victim to {_location}
    16.         wait 5 seconds
    17.         set victim's gamemode to survival
    18.         set victim's health to 10
     
  2. Best Answer:
    Post #2 by DieHollander_, Jun 3, 2018
  3. DieHollander_

    DieHollander_ Active Member

    Joined:
    Mar 25, 2018
    Messages:
    171
    Likes Received:
    12
    You could set there flying speed to 0
     
  4. ItsMCB

    ItsMCB Member

    Joined:
    May 20, 2018
    Messages:
    46
    Likes Received:
    1
    That's a really good idea, I'm surprised I didn't think of it, thank you.
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...