Is there a way to make a player count?

So basically i wanna know how to make a script that would allow me to check the playercount of a game inside a different game… i currently have a multi-game hub in progress and i want a little thing that would tell you the amount of players playing on a certain game…

1 Like

As far as I’m aware, to get the player coung of another game you would need to contact the Roblox website, which needs a proxy (like cors.bridged.cc), and I don’t think this data is exposed in the public API, so you might have to scrape and parse the HTML.

1 Like

man, :sweat: i wish i knew what you are talking about… what/how would i do that?
or maybe theres a ytvideo explaining?

1 Like

As far as I’m aware Roblox does not make it easy to know the game count, especially of other games.

You’d need to use HTTPService to go out to the Roblox website, and get it from there, however this is not allowed from games for security reasons, however we can use a proxy which will get around this restriction.

I’ll have a look if I can find a solution for you.

well it just that with others games ive seen like “Live Game Statistics Checker” They were able to get the number of people on a game…
game link:
(1) Live Game Statistics Checker - Roblox

There is a Roblox web API that lets you grab info about your servers https://games.roblox.com/docs#!/Games/get_v1_games_placeId_servers_serverType in order to use this you will have to know how a GetRequest works(pretty sure you will also have to JSONDecode the result) this will save you from having to store the players amount for each server inside datastores.

If the other games are made by you, maybe there is some setting, description etc that you can use a script in each game to save the player count for that game to. Then you might be able to read whatever that is saved in by the main game hub and display it. I’m sorry that is the best I can think of. :expressionless:

Or could you do it with a plugin or toolbox item that you could make?

Alr! thanks for the brainstorming/help… ill be sure to learn more about this!

pretty sure this one only requires the use of a proxy. (it does not mention anything about authentication like most other APIs and its a GET request)

local gameId = 245662005

local http = game:GetService("HttpService")
local response = http:GetAsync("https://games.rprxy.xyz/v1/games?universeIds=" .. gameId)
local data = http:JSONDecode(response)["data"]
print(data[1]["name"] .. " has " .. data[1]["playing"] .. " players online!")

outputs the following:

Jailbreak has 22294 players online!
2 Likes

It’s easily possible with MessagingService | Roblox Creator Documentation.

everytime i try to enter my own game i keep getting the error "attempt to index nil with ‘name’ "