Need help making entities not see a specific player

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

k6w

Member
Dec 31, 2020
1
0
1
Hello, I'm new to to scripting and I've been trying to make mobs not attack specific players and can't find out why my code does not work. There are also no errors when I reload it.

Code:
command /ghost:
    trigger:
        if {g.%player%} is not set:
            set {g.%player%} to false
        if {g.%player%} is false:
            set {g.%player%} to true
            send "&3You are now a ghost&6!"
        else if {g.%player%} is true:
            set {g.%player%} to false
            send "&3You are no longer a ghost&6!"

on entity target:
    if target is a player:
        if {g.%player%} is true:
            cancel event
        
on join:
    if {g.%player%} is true:
        send "&3You are a ghost&6!"
 
Status
Not open for further replies.