Removing a player from player count

  • 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
I have a vanish script, and i want to make it so if i go in vanish, in server player count, it goes down by 1, so it looks like i actually left the game.

I'm using

Skript 2.2 dev 25
Spigot 1.8.9
Bungeecord 1.11
Skellett (Latest)
SkellettProxy (Latest)

I tried searching on the docs for like 30 mins, couldn't find anything. I really want to do this!
 
I have a vanish script, and i want to make it so if i go in vanish, in server player count, it goes down by 1, so it looks like i actually left the game.

I'm using

Skript 2.2 dev 25
Spigot 1.8.9
Bungeecord 1.11
Skellett (Latest)
SkellettProxy (Latest)

I tried searching on the docs for like 30 mins, couldn't find anything. I really want to do this!
Use basic math with the server list ping event. If your using list variables this is easy (but you have a habit of not using lists...)
 
As far as I know there's no way to do this in skript. However, you could get this https://www.spigotmc.org/resources/fakeplayersonline.6685/ (which requires protocolib) then doing something along these lines:

code_language.skript:
#when someone goes in vanish:
    set {_vanished_player_amount} to size of {list_of_vanished_players::*}
    set {_player_count} to difference between amount of players online and {_vanished_player_amount}
    execute console command "/fpo online %{_player_count}%"
 
As far as I know there's no way to do this in skript. However, you could get this https://www.spigotmc.org/resources/fakeplayersonline.6685/ (which requires protocolib) then doing something along these lines:

code_language.skript:
#when someone goes in vanish:
    set {_vanished_player_amount} to size of {list_of_vanished_players::*}
    set {_player_count} to difference between amount of players online and {_vanished_player_amount}
    execute console command "/fpo online %{_player_count}%"
You can do this in skript.
[doublepost=1495661218,1495661181][/doublepost]
@Pikachu What do you mean by "basic math" "with the server list ping event" there isn't an event to change the player count
yes there is. I literally told you the event...
 
You can do this in skript.
[doublepost=1495661218,1495661181][/doublepost]
yes there is. I literally told you the event...

Sure there's the event:
code_language.skript:
on server ping
but there's no effect to actually change the counter?
--
Adrihun I haven't tested it so I don't know if it would work on bungeecoord you'll just have to play around with it.
 
  • Like
Reactions: Adrihun
@Donut you know where it says "{list_of_vanished_players::*}" , My script doesn't have a "vanished players list variable", only has a player list variable for those who can't see the vanished player "{sql.__Vanish::*}"
 
@Donut you know where it says "{list_of_vanished_players::*}" , My script doesn't have a "vanished players list variable", only has a player list variable for those who can't see the vanished player "{sql.__Vanish::*}"

Make one then...
code_language.skript:
#when someone goes in vanish
    add player to {list_of_vanished_players::*}
 
  • Like
Reactions: Adrihun
Sure there's the event:
code_language.skript:
on server ping
but there's no effect to actually change the counter?
--
Adrihun I haven't tested it so I don't know if it would work on bungeecoord you'll just have to play around with it.
Yeah, there is an effect for it. I don't remember it off hand.
 
@Pikachu Then write it down here
@Donut
code_language.skript:
Can't understand this expression: ('difference between amount of players online' and {_vanished_player_amount}) (code.sk, line 50: set {_player_count} to difference between amount of players online and {_vanished_player_amount}')
 
try: set {_online_players} to amount of players online
set {_player_count} to difference between {_online_players} and {_vanished_player_amount}

you could honestly fix simple stuff like this on your own if you just rearrange stuff and try different ways of doing it
 
Status
Not open for further replies.