Death help

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

JustADev

Well-Known Member
Apr 8, 2017
379
9
18
22
Q: How do I make it so that if you kill yourself, it doesnt make you execute the command "/g1234"

Code:
code_language.skript:
    if damage was caused by attack:
        if victim is player:
            if {DeathMessages} is set:
                set {VHealth::%attacker%} to rounded health of attacker
                make player execute command "/g123e73"
                set the death message to "&cDeath &8&l» &c%victim% &7was killed by &c%attacker%"
                send "&cKill &8&l» &7You have killed &a%victim% &7and have received &a1 XP" to attacker
                send "" to victim
                send "&aHealth &8&l» &c%attacker% &7was at &c%{VHealth::%attacker%}% &c❤" to victim
            else:
                set the death message to ""
                send "&cKill &8&l» &7You have killed &a%victim% &7and have received &a1 XP" to attacker
                send "" to victim
                send "&aHealth &8&l» &c%attacker% &7was at &c%{VHealth::%attacker%}% ❤" to victim
 
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
 
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
or simply check if the victim is the attacker before executing the command...
 
Status
Not open for further replies.