How to check an entity name?

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

FishRekt

Active Member
Jan 26, 2017
87
0
0
Hello. I want to check the name of an entity that was killed to regenerate it. Just like.. MMORPGs.
I have a foundation to do it, but it doesn't check the name of the killed entity, then i can't do nothing..

That's the skript:
code_language.skript:
on death:
    if victim is a pig named "&7Pig [Lvl.&a1&7]":
        broadcast "A pig just died.."

I know that this doesn't make an entity respawn, but i know how to do it, so i don't post it here to ask help. I just need an help to check the name of the died entity. Just like.. I don't know. I tried all the possibilities in my knowledge of skript. And sorry for my bad english.. I'm italian.
 
code_language.skript:
on death of pig:
    if name of victim is "&7Pig [Lvl.&a1&7]":
 
I've tried this before, but nothing happened. I think that is a mistake made by me in the main code.. I did so to configure it out to be easier.
code_language.skript:
on death:
    if victim is a pig:
        if victim's display name is "&7Pig [Lvl.&a1&7]":
            etc...

I swear, i thank you for the support, and if you have a better whay to do what i want to do, just tell me. I'll accept all of your helps, and if this is the right way to do what i want to do, just tell me and i'll close this post making your answer the solution. Thank you ^-^
 
code_language.skript:
on death:
    if victim is a pig:
        if victim's display name is "Xeno":
            broadcast "oof"
This is working perfectly fine for me, I suggest you update your skript, in particular use bensku's dev 25 version.
 
Status
Not open for further replies.