Solved Npc 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 community!

    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.

Turb032

Active Member
Jan 16, 2020
109
0
16
Hi guys, i really need help. I want to make that when an npc is killed, it does something, like this:
Code:
on npc death:
    if victim's name is "test":
        #do something
but it won't work. Please help!
 
Hi guys, i really need help. I want to make that when an npc is killed, it does something, like this:
Code:
on npc death:
    if victim's name is "test":
        #do something
but it won't work. Please help!
You chan check on death of entity instead
 
I just tried this, no errors.
Code:
on death:
    if entity is npc:
        if entity's name is "test":
            send "Yeah" to attacker
but nothing, the message won't show up
 
Code:
on death:
    if victim is a entity:
        if name of entity is "Your npc name here":
            do stuff
 
nothing happens.. It's like skript won't read it, when i load the skript it says no errors.
 
ohh im stupid, it's because I set it to check for "if name of entity is "name", when it should be "if name of victim is "name".
[doublepost=1589564735,1589564704][/doublepost]
Code:
on death:
    if victim is a entity:
        if name of victim is "name":
            send "it works" to attacker
 
ohh im stupid, it's because I set it to check for "if name of entity is "name", when it should be "if name of victim is "name".
[doublepost=1589564735,1589564704][/doublepost]
Code:
on death:
    if victim is a entity:
        if name of victim is "name":
            send "it works" to attacker
mh no, doesn't works xd, it's maybe something else that corrupts the skript? maybe some plugin?
 
I meant, edit the other message and replace aaallll the text with the link
ah oof, ok xD
[doublepost=1589568874,1589566322][/doublepost]i tried in all ways, but did nothing, idk why
[doublepost=1589579822][/doublepost]if you want details: The NPC is done by Citizens and Sentinel, with sentinel i change it's health and respawntime, at this point im thinking that there's a plugin conflicting with the skript, or maybe, other skripts that do the same (i have 7 skript in the folder).
[doublepost=1589581482][/doublepost]Ooooh im literally soo stupid!! There was a skript changing the attack damage of swords. Here is the skript:
Code:
on damage:
    if victim is npc:
        if attacker's held item's name is "&b&lStarter Sword":
            cancel event
            damage victim by 1 heart

this was the problem, because the attacker doesn't really deal damage to the victim, so it doesn't count as a kill. Im sorry im literally so stupid!
 
ah oof, ok xD
[doublepost=1589568874,1589566322][/doublepost]i tried in all ways, but did nothing, idk why
[doublepost=1589579822][/doublepost]if you want details: The NPC is done by Citizens and Sentinel, with sentinel i change it's health and respawntime, at this point im thinking that there's a plugin conflicting with the skript, or maybe, other skripts that do the same (i have 7 skript in the folder).
[doublepost=1589581482][/doublepost]Ooooh im literally soo stupid!! There was a skript changing the attack damage of swords. Here is the skript:
Code:
on damage:
    if victim is npc:
        if attacker's held item's name is "&b&lStarter Sword":
            cancel event
            damage victim by 1 heart

this was the problem, because the attacker doesn't really deal damage to the victim, so it doesn't count as a kill. Im sorry im literally so stupid!

haha thats okay, i'm glad to hear the issue has been resolved.
Mark as "solved" by setting the best comment as "best anwser"
 
Status
Not open for further replies.