Solved Anti Phantom for player Skript

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

harman

Member
Oct 12, 2022
2
0
1
21
Suggested name: Anti Phantom
Spigot/Skript Version: Server 1.19.2 - Skript 2.6.3

What I want:
I want people to be able to turn phantoms created for them on and off with the /antiphantom command.

Ideas for commands:
/antiphantom

Ideas for permissions:
antiphantom.use
When I'd like it by: No real deadline but ASAP


if theres already a working one out there let me know, i cant find any. (at least free)
 
Suggested name: Anti Phantom
Spigot/Skript Version: Server 1.19.2 - Skript 2.6.3


What I want:
I want people to be able to turn phantoms created for them on and off with the /antiphantom command.

Ideas for commands:
/antiphantom

Ideas for permissions:
antiphantom.use
When I'd like it by: No real deadline but ASAP

if theres already a working one out there let me know, i cant find any. (at least free)
Code:
command /antiphantom [<text>]:
  permission: antiphantom.use
  trigger:
    if {-p::%uuid of player%::antiPhantom} is set:
      delete {-p::%uuid of player%::antiPhantom}
      send "&c> &fAntiphantom deactivated"
    else:
      set {-p::%uuid of player%::antiPhantom} to true
      send "&a> &fAntiphantom activated"
on entity target:
  if event-entity is phantom:
    if {-p::%uuid of target%::antiPhantom} is true:
      delete event-entity
      cancel event
 
Code:
command /antiphantom [<text>]:
  permission: antiphantom.use
  trigger:
    if {-p::%uuid of player%::antiPhantom} is set:
      delete {-p::%uuid of player%::antiPhantom}
      send "&c> &fAntiphantom deactivated"
    else:
      set {-p::%uuid of player%::antiPhantom} to true
      send "&a> &fAntiphantom activated"
on entity target:
  if event-entity is phantom:
    if {-p::%uuid of target%::antiPhantom} is true:
      delete event-entity
      cancel event
Thank you ^^