Is it currently possible to get the amount of players in a game on Roblox that isn’t a connected to yourself or your universe?
I’m looking to make a community hub for the colonial era of war groups on Roblox and would love to be able to list a bunch of battle maps from group owners and say how many are currently in that game.
If this is currently not possible within Roblox, can anyone recommend a free service that would be able to send the requests needed?
I think what he means is that you can use a third party service to easily get the player count since it’s displayed on the game page of any game you have the Id of.
I did some research to see if there was a web api for this, but there wasn’t.
Perhaps someone could suggest this in feature suggestions?
Yes, this is possible. It requires http services to scrape the web page of a roblox poxy.
web= game.HttpService:GetAsync("https://www.rprxy.xyz/games/Place ID goes here")
After that, it’s just string manipulation to get the number of players off the site.
function players_online(place_id)
local web = game.HttpService:GetAsync("https://www.rprxy.xyz/games/"..place_id)
local player_text = string.find(web,"Playing") -- find the online players section
local new = string.sub(web,player_text)
local number_start = string.find(new,">") -- find where the number starts
new = string.sub(new,number_start)
local number_end = string.find(new,"<") -- find where the number ends
new = string.sub(new,2,number_end-1)
local players_online = string.gsub(new,",","") -- in case it's over 1000 players
return tonumber(players_online)
end