How do I get the amount of players within a Place, that's in a Universe, without it returning the Start Place's player count?

I would like to create a player count script that will return the amount of players that are playing within a Place that’s in a Universe.

However, when using something like rprxy.xyz, it returns the amount of players that are playing in the start place. I last tried this around June this year, it didn’t work, and it seems like it still doesn’t.

Here’s my current code:

functions.GetPlayersOnline.OnServerInvoke = function(plr, place_id)
	print(plr.Name..":"..place_id)
	local web = game.HttpService:GetAsync("https://www.rprxy.xyz/games/"..place_id)
	local player_text = string.find(web,"Playing")
	local new = string.sub(web,player_text)
	
	local number_start = string.find(new,">")
	new = string.sub(new,number_start)
	
	local number_end = string.find(new,"<")
	new = string.sub(new,2,number_end-1)
	
	local players_online = string.gsub(new,",","")
	return tonumber(players_online)
end

Thanks for reading!

you can use messagingservice, send a message to the place from the start place (i believe), which then you can script getting the player count and return it.

i’m new to messagingservice, so i’m not sure how to engage with it but here’s the link. i’m doing the same thing right now actually lol

Hey, I believe you have to create your own proxy, I created one in nodejs express, so you can get an idea of how it works:

Roblox Code:

local res = game.HttpService:GetAsync("https://aeff2c12da8e.ngrok.io/games/"..game.PlaceId)
print(res) --Prints the data 

NodeJS Code:

const express = require("express");
const app = express();
const axios = require("axios");

app.get("/games/:id", function (req, res) {
  const placeId = req.params.id;

  const httpInstance = axios.create();

  const url = `https://games.roblox.com/v1/games?universeIds=${placeId}`;

  httpInstance.get(url).then(function(response) {
    console.log(response.data)
    res.send(response.data);
  });
});

app.listen(3000, () => {
    console.log("Successfully connected proxy!")
})
3 Likes