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 our 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 If entity's name tag is..

Discussion in 'Skript' started by Scholler, Jun 4, 2019.

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

    Scholler Well-Known Member

    Joined:
    Aug 6, 2018
    Messages:
    103
    Likes Received:
    5
    So I am an owner of a server (actually my server, lol), and I have a dog(wolf). I don't want players to attack it, so I want to make a script, so when a player hit the dog, it heals it and kicks the player.

    This is my current code:

    Code (Text):
    1. on damage:
    2.     if attacker is player:
    3.         if entity is wolf:
    4.             entity's name is "Owner Dog!"
    There is no error but it doesn't works (I have a kick attacker due to ... after it)
    And I named the wolf so I got a nametag, renamed it in an anvil and right clicked with it on the wolf.
    So.. How can I do this? Thanks!

    EDIT: Solved on Discord.
     
    #1 Scholler, Jun 4, 2019
    Last edited: Jun 4, 2019
  2. D

    Dan_k Active Member

    Joined:
    Apr 25, 2019
    Messages:
    28
    Likes Received:
    0
    can you send here the solution?
     
  3. S

    Scholler Well-Known Member

    Joined:
    Aug 6, 2018
    Messages:
    103
    Likes Received:
    5
    It's

    Code (Text):
    1. on damage:
    2.     if attacker is player:
    3.         if victim is a wolf:
    4.             if victim's name is "Owner Dog!"
    Replace entity with victim
     
  4. D

    Dan_k Active Member

    Joined:
    Apr 25, 2019
    Messages:
    28
    Likes Received:
    0
    Okey, thank you
     
Thread Status:
Not open for further replies.
Loading...