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.

Death help

Discussion in 'Skript' started by JustADev, Aug 27, 2017.

Thread Status:
Not open for further replies.
  1. JustADev

    JustADev Well-Known Member

    Joined:
    Apr 8, 2017
    Messages:
    380
    Likes Received:
    9
    Q: How do I make it so that if you kill yourself, it doesnt make you execute the command "/g1234"

    Code:
    Code (Skript):
    1.     if damage was caused by attack:
    2.         if victim is player:
    3.             if {DeathMessages} is set:
    4.                 set {VHealth::%attacker%} to rounded health of attacker
    5.                 make player execute command "/g123e73"
    6.                 set the death message to "&cDeath &8&l» &c%victim% &7was killed by &c%attacker%"
    7.                 send "&cKill &8&l» &7You have killed &a%victim% &7and have received &a1 XP" to attacker
    8.                 send "" to victim
    9.                 send "&aHealth &8&l» &c%attacker% &7was at &c%{VHealth::%attacker%}% &c❤" to victim
    10.             else:
    11.                 set the death message to ""
    12.                 send "&cKill &8&l» &7You have killed &a%victim% &7and have received &a1 XP" to attacker
    13.                 send "" to victim
    14.                 send "&aHealth &8&l» &c%attacker% &7was at &c%{VHealth::%attacker%}% ❤" to victim
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    you could use the on command event to set a variable to true if the suicide command is used. check if that is true or not before the /g1234 command is executed. then set it back to false or delete it at the end of this code
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    or simply check if the victim is the attacker before executing the command...
     
Thread Status:
Not open for further replies.

Share This Page

Loading...