TeleportService:GetNumPlayersIn PlaceAsync(PlaceId)

Because of Discourse’s title error,


This is the title.

It’s supposed to be “TeleportService:GetNumPlayersInPlaceAsync(PlaceId)”


What this does is that it gets the # of players in the place within the universe. It can only be used within a game.

There is no real easy way to get the # of players in a place within a universe without using HttpService and some serious hacks with code.

This is useful when I have a board in the lobby that splits up to many different other places within it. The board will show the # of players in them.

Another use is sorting places within a universe through popularity. The most popular place, the place where the most people are playing within the universe, can appear on the top.


(P.S. How do you get the individual servers of a place within a universe and players in those servers? I want to count the # of players in the servers of each place so it would return that in the meantime. I recognize Auto Duels and R2DA boasting that feature of listing all the individual servers with users showing in them)

5 Likes

Support.
You can also use DataStores to accomplish this currently.

Also would like:

  • array GetRunningServersInPlaceAsync(int PlaceId, int MaxServers, function MaxServersSortFunction)
    MaxServers is the maximum number of servers to return
    – The sort function is for sorting through the servers (although this might defeat the point of having the MaxServers argument?)
  • array GetPlayersInServerAsync(int JobId)

This seems a bit of a niche statistic to have access to. If there are 500 people playing in a place, that doesn’t say anything about the server of that place that the player is about to join. People care more often about which of their friends (if any) are playing in that place, or they would like full server list information instead.

2 Likes

DataStores are inefficient and unreliable in this situation to keep track of players. Sometimes DataStores errors.

If anything, this should be returning instances, unique identifiers and the number of players in that instance, using a place’s Id to determine what place’s instances are being grabbed.

It seems useless to know how many players are at a place because Roblox already displays that on the website, and there’s certainly no use in grabbing how many players are playing a game.


Just to be clear with any confused individual, terminology:
[Format Proper term = Common term]
Instance = Server
Place = Game
Game = Universe

Support. This would make hubs a lot more efficient to use :slight_smile:

1 Like

Defo Support. As someone who uses a Main Menu Place that links to others it’d be nice to display to people how many players are playing in each different Place connected to the Menu Place via the Universe.

Can we please have this? Currently there are NO endpoints to get # of plrs.