I develop a game where it has many different places within the game that you teleport to, and on the menu of the game, I want to list the number of players in each place.
I am not sure how I would perform this, as I don’t know a function or anything I could use to get the player amount in the specific place within the game. I heard about proxies, but I don’t know how I would use them
If anyone knows a good solution, a reply would be appreciated
You could add a player counter where everytime a player join a place it adds 1 and when a player leaves, it substracts 1. You then make a gui that displays that counter.
I suggest using https://games.roblox.com/docs#!/Games/get_v1_games_placeId_servers_serverType (the /v1/games/{placeId}/servers/{serverType} part) basically you can use a proxy like https://rprxy.xyz/ or your own and send a request to this API for a specific place and server type
this API returns a table with each server and the amount of players it has(and other useful info like max players)
but before using this method I suggest watching some tutorials about Roblox Http requests and how they work.
Try this:
Once the player enters the game a BooleanValue enters his body.
Make a giant invisible cube of the area they need to be in.
If they touch the invisible cube the Value is set to true.
You add a thin invisible zone right the big cube on all directions and and when they touch that part their Value is set to false.
I remember making something very similar to this, here are very simplified steps on how I remember doing it:
-Using subscribeAsync and publishAsync
-Every 10 - 30 seconds send a new 'request' which basically asks each server for the amount of players (you can easily make it only count in a specific place instead of every place)
-Since each request has a different 'id' it never duplicates
-Add them all together, and voila