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.

Stop Mobs Seeing you (Following & Attacking)

Discussion in 'Skript' started by xCraimax, Oct 12, 2020.

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

    xCraimax Member

    Joined:
    Aug 15, 2020
    Messages:
    1
    Likes Received:
    0
    Hello, i'm creating a Vanish script and i want to stop mobs seeing, following and attacking you. I don't found any Informations about this. I hope somebody can help me :emoji_slight_smile:
     
  2. Time4Games

    Time4Games Active Member

    Joined:
    Jul 25, 2020
    Messages:
    203
    Likes Received:
    4
    do you want it to hide you from other players too?
     
  3. Wynnevir

    Wynnevir Well-Known Member

    Joined:
    Jul 9, 2017
    Messages:
    1,015
    Likes Received:
    62
    https://docs.skunity.com/syntax/search/id:181
    Try this expression from skellet. This way you wouldnt need a plugin like essentials, though if you are using essentials it'd be easier to just go through it's commands.

    One thing though, you'd probably have to account for people joining as they'd still be able to see. So you could keep the vanished players in a list like this for example; {vanishedpeeps::*} and on the join event, loop that list and make them not visible for the joining player too
     
  4. Time4Games

    Time4Games Active Member

    Joined:
    Jul 25, 2020
    Messages:
    203
    Likes Received:
    4
    you can just do
    Code (Text):
    1. hide player from all players
     
    Wynnevir likes this.
  5. Wynnevir

    Wynnevir Well-Known Member

    Joined:
    Jul 9, 2017
    Messages:
    1,015
    Likes Received:
    62
    Ye! Think you still need to account for newly joining players though, I'm not at my PC to test however.
     
  6. Time4Games

    Time4Games Active Member

    Joined:
    Jul 25, 2020
    Messages:
    203
    Likes Received:
    4
    Code (Text):
    1. command /vanish:
    2.     permission:op
    3.     trigger:
    4.         if {vanish.%player%} is true:
    5.             delete {vanish.%player%}
    6.             reveal player to all players
    7.             send "&cYou are no longer vanished"
    8.         else:
    9.             set {vanish.%player%} to true
    10.             hide player from all players
    11.             send "&cYou are now vanished"
    12.  
    13. on join:
    14.     loop all players:
    15.         if {vanish.%loop-player%} is true:
    16.             hide loop-player from all players
     
Thread Status:
Not open for further replies.

Share This Page

Loading...