Solved Need help with player vanishing!

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

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

Adrihun

Member
Feb 1, 2017
368
6
0
So i tested this script with both of my accounts. And it works, but whenever the default group player quits, and joins back in, the admin's vanish mode turns off..

How can I fix this?

I think it is caused by the 'on quit:' part, but I want to make it so it only turns off the vanish mode if the admin quits. Not a random player on the server.

code_language.skript:
command /Vanish:
    permission: Vanish.use
    permission message: no no
    trigger:
        if {sql_.mineplex.Vanish.%player%} is true:
            loop all players:
                loop-value doesn't have permission "Vanish.see"
                add loop-value to {_Vanishto::*}
            reveal player from all players
            set {sql_.mineplex.Vanish.%player%} to false
            send "not vanishd"
            loop all players:
                loop-value doesn't have permission "Vanish.see"
                send "join %player%" to loop-player
        else:
            loop all players:
                loop-value doesn't have permission "Vanish.see"
                add loop-value to {_Vanishto::*}
                send "quit %player%" to loop-player
            hide player from {_Vanishto::*}
            set {sql_.mineplex.Vanish.%player%} to true
            send "vanishd"
            while {sql_.mineplex.Vanish.%player%} is true:
                show an action bar from "you are in vanish" to player
                wait a second

on quit:
    reveal player from all players
    set {sql_.mineplex.Vanish.%player%} to false
    wait 1 tick
    delete {sql_.mineplex.Vanish.%player%}
[doublepost=1495204508,1495141115][/doublepost]Bump
 
its caused by the
code_language.skript:
hide player from {_Vanishto::*}
part. If a player joins, you have to hide all vanished players from him again.
 
@sapphyrusxyz I added this

code_language.skript:
on join:
    loop all players:
        if {sql_.vanish.%loop-player%} is true:
            player doesn't have permission "Vanish.see":
                add player to {_vanish::*}
It won't work, i join with my other acc and i can still see the vanishd player? :C
btw I know the variables and stuff look different, i just updated the script so changed the variable names

It should work!
Why isn't it working?
 
@sapphyrusxyz I added this

code_language.skript:
on join:
    loop all players:
        if {sql_.vanish.%loop-player%} is true:
            player doesn't have permission "Vanish.see":
                add player to {_vanish::*}
It won't work, i join with my other acc and i can still see the vanishd player? :C
btw I know the variables and stuff look different, i just updated the script so changed the variable names

It should work!
Why isn't it working?

code_language.skript:
on join:
    loop all players:
        if {sql_.vanish.%loop-player%} is true:
            player doesn't have permission "Vanish.see":
                add player to {_vanish::*}
                hide loop-player from player

try that
I dont really understand your variables tbh..
 
Don't bump your posts too often, please. The forums merge double posts anyways. Give 24 hours between bumps.
 
Status
Not open for further replies.