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

Sep 30, 2024
2
0
1
I have a vanish skript which I got from someone as below,
Code:
command /vanish [<player>]:
    aliases: v
    permission: vanish.use
    permission message: {@no-perms}
    trigger:

        #set var to sender, override when argument is set
        set {_target} to sender
        set {_target} to arg-1 if arg-1 is set

        #check if target is console, if true, send error
        {_target} = console:
            send "&cPlease define a argument when executing the command from console!"
            send "&cUsage: /vanish <player>"
            stop

        #check if target is the executor, if not check permission
        else if {_target} != player:
            player does not have permission "vanish.others"
            send "{@no-perms}"
            stop

        #else, toggle target's vanish state and send message to executor
        toggleVanish({_target})
        {_target} != sender
        send "{@prefix} &7Successfully &aenabled &7%arg-1%'s vanish!" if {vanish::%uuid of {_target}%} is set
        send "{@prefix} &7Successfully &cdisabled &7%arg-1%'s vanish!" if {vanish::%uuid of {_target}%} is not set

#Funcion to toggle a player's vanish
function toggleVanish(p: player):

    #if vanish is disable, enable
    if {vanish::%uuid of {_p}%} != true:
        set {vanish::%uuid of {_p}%} to true
        hide {_p} from all players where [input does not have permission "{@bypass-perm}"]
        send "{@prefix} &7Other player's can now &cno longer &7see you!" to {_p}
        broadcast "{@leave-message}" if {@fake-join-leave-message} = true

    #if vanish is enable, disabled
    else:
        delete {vanish::%uuid of {_p}%}
        reveal {_p} to all players
        send "{@prefix} &7Other player's can now &asee you &7again!" to {_p}
        broadcast "{@join-message}" if {@fake-join-leave-message} = true

This works, but Im trying to make it so on tablist, and when a player sees another player, their nametag had a [V] to the left side of their name. Please suggest how to do this.
 
you can
Code:
command /vanish [<player>]:
    aliases: v
    permission: vanish.use
    permission message: {@no-perms}
    trigger:

        #set var to sender, override when argument is set
        set {_target} to sender
        set {_target} to arg-1 if arg-1 is set

        #check if target is console, if true, send error
        {_target} = console:
            send "&cPlease define a argument when executing the command from console!"
            send "&cUsage: /vanish <player>"
            stop

        #check if target is the executor, if not check permission
        else if {_target} != player:
            player does not have permission "vanish.others"
            send "{@no-perms}"
            stop

        #else, toggle target's vanish state and send message to executor
        toggleVanish({_target})
        {_target} != sender
        send "{@prefix} &7Successfully &aenabled &7%arg-1%'s vanish!" if {vanish::%uuid of {_target}%} is set
        send "{@prefix} &7Successfully &cdisabled &7%arg-1%'s vanish!" if {vanish::%uuid of {_target}%} is not set

#Funcion to toggle a player's vanish
function toggleVanish(p: player):

    #if vanish is disable, enable
    if {vanish::%uuid of {_p}%} != true:
        set player's tablist name to "[V] %player%"
        set {vanish::%uuid of {_p}%} to true
        hide {_p} from all players where [input does not have permission "{@bypass-perm}"]
        send "{@prefix} &7Other player's can now &cno longer &7see you!" to {_p}
        broadcast "{@leave-message}" if {@fake-join-leave-message} = true

    #if vanish is enable, disabled
    else:
        set player's tablist name to "%player%"
        delete {vanish::%uuid of {_p}%}
        reveal {_p} to all players
        send "{@prefix} &7Other player's can now &asee you &7again!" to {_p}
        broadcast "{@join-message}" if {@fake-join-leave-message} = true