1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Removing a player from player count

Discussion in 'Skript' started by Adrihun, May 24, 2017.

Thread Status:
Not open for further replies.
  1. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Lol you just don't want the proof against you laying around.

    I request this to not be deleted.
     
    • Agree Agree x 1
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    It's definitely possible, I've done it before. It's just question of trial and error. I lost that code so I wouldn't be able to show you how I did it, sadly.
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    It's possible, I did it in that screenshot on game version 1.8.8 (latest MundoSK beta), pretty much in the same way as your code except I combined some lines.
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Okay so what do i do
     
  8. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    You google it.
     
  9. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    When a status_server_server_info packet is sent, put serverping pjson number 0 of the packet into a list variable
    then set
    Code (Text):
    1. {_list::players::online}
    to your number then set the serverping pjson 0 of the packet to the json form of the list variable you put it into and edited
     
  10. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    I know he is hated because he has nearly 400 posts and all of them were asking for help (spoonfeeding generally) but there is no reason to bash on him all the time, this isn't even on google because no one did this before on a public script (such as this is a kind of new feature). If you're not going to help in any way then just go away.
     
    • Agree Agree x 1
  11. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    @Pikachu Yeah.

    Code (Skript):
    1. put json {_oldjson} in listvar {_server info::*}
    It should work?
     
  12. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Since you didn't post the rest of the code I can't tell you if it should work or not
     
  13. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    @Pikachu Idk?

    Code (Skript):
    1. on packet event status_server_server_info:
    2.     set {_oldjson} to "serverping" pjson 0 of event-packet
    3.     set {_server info::players::online} to 50
    4.     put json {_oldjson} in listvar {_server info::*}
    5.     set {_newjson} to json of listvar {_server info::*}
    6.     set "serverping" pjson 0 of event-packet to {_newjson}
    7.     broadcast "%{_oldjson}%"
     
  14. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    switch lines 3 and 4 and it may work.
     
  15. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    @Pikachu It doesn't change the player counter, but this is what it broadcasts

    Code (Skript):
    1. {"players":{"max":50,"online":0},"description":"","version":{"protocol":47,"name":"Spigot 1.8.8"}}
     
  16. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Post the new code
     
  17. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    @Pikachu I didn't change the code. Lol
     
  18. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Then do what I said, switch lines 3 and 4
     
  19. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    @Pikachu Same thing happens

    Code (Skript):
    1. on packet event status_server_server_info:
    2.     set {_oldjson} to "serverping" pjson 0 of event-packet
    3.     put json {_oldjson} in listvar {_server info::*}
    4.     set {_server info::players::online} to 50
    5.     set {_newjson} to json of listvar {_server info::*}
    6.     set "serverping" pjson 0 of event-packet to {_newjson}
    7.     broadcast "%{_oldjson}%"
     
  20. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    I guess you've tried enough... use this:
    Code (Skript):
    1. on packet event status_server_server_info:
    2.   put json "serverping" pjson 0 of event-packet in listvar {_l::*}
    3.   set {_l::players::online} to 50
    4.   set "serverping" pjson 0 of event-packet to json of listvar {_l::*}
     
Thread Status:
Not open for further replies.

Share This Page

Loading...