How to show how much players in different places?

i wanne show how many people are in places but I don’t know how if anyone can help I found this it doesn’t work

local HttpService = game:GetService("HttpService")

local QUERY_URL = "https://games.rprxy.xyz/v1/games?universeIds="
local GAME_ID = game.GameId

-- "https://games.rprxy.xyz/v1/games?universeIds=000000"
local endpointResponse = HttpService:GetAsync(QUERY_URL .. GAME_ID)
local decodedResponse = HttpService:JSONDecode(endpointResponse)
local gameData = decodedResponse.data

local gameInformation = gameData[1]
local playersInGame = gameInformation.playing

print(playersInGame) -- 0

any post didn’t help me and no youtube video with that

Refer to this topic. rprxy has shut down and it’s no longer available for use.

1 Like

what do i do then :sweat_smile: if there isnt then?

Uh, I think RoProxy is an alternative. Not sure why would anyone want to use proxies anyway, just host your own.

1 Like

can i use replit? or doesnt it work??

Replit is not a proxy. If you found rprxy on Replit, same result, it’s shut down.

well i dont know what I need to do I’m confused

rprxy is a proxy. A proxy is a server or computer that acts as an intermediary between your computer and the internet. When you connect to the internet, you do so through a proxy, which then connects you to other websites or services.

Because HttpService cannot send a GET request directly to the Roblox API, a proxy is needed. We call a GET request on the proxy, which will send a request to the Roblox API. The response from Roblox will then be sent to said proxy, and the proxy will send the data back to the game. It’s a simple explanation of how Proxies work.

Rprxy, a popular proxy, has been shut down one year ago and has been since replaced with RoProxy. There are many alternatives, and I personally don’t use proxies, so you’ll have to get someone else to tell ya.

1 Like

oof ok but i dont think anyone reading this

local HttpService = game:GetService("HttpService")
local Url = "https://games.roblox.com/v1/games"

local PlaceId = "PlaceId as a string"
local UniverseId = tostring(HttpService:JSONDecode(HttpService:GetAsync(Url.."/multiget-place-details?placeIds="..PlaceId)).universeId)
local PlayingCount = HttpService:JSONDecode(HttpService:GetAsync(Url.."?universeIds="..UniverseId)).playing

print(PlayingCount)

I haven’t tested but it should works :slight_smile:

Http requests can only be executed by game server error

put the codes on the server side

1 Like

HttpService is not allowed to access ROBLOX resources error

it didnt work mate what sould i do

local HttpService = game:GetService("HttpService")
local Url = "https://games.roblox.com/v1/games"

local PlaceId = "11287336762"
local UniverseId = tostring(HttpService:JSONDecode(HttpService:GetAsync(Url.."/multiget-place-details?placeIds="..PlaceId)).universeId)
local PlayingCount = HttpService:JSONDecode(HttpService:GetAsync(Url.."?universeIds="..UniverseId)).playing

print(PlayingCount)
script.Parent.ImageLabel.game1.PlayerCount.Text = PlayingCount

You can only http request on Server Script.
Try these :
• Add a new RemoteEvent in ReplicatedStorage and rename it to “GetPlayingCount” (for example).
• Add a new Script to ServerScriptService and change code to

local HttpService = game:GetService("HttpService")
local Url = "https://games.roblox.com/v1/games"
local GetPlayingCountEvent = game.ReplicatedStorage.GetPlayingCount

GetPlayingCountEvent.OnServerEvent:Connect(function(Player, PlaceId)
    local UniverseId = tostring(HttpService:JSONDecode(HttpService:GetAsync(Url.."/multiget-place-details?placeIds="..PlaceId)).universeId)
    local PlayingCount = HttpService:JSONDecode(HttpService:GetAsync(Url.."?universeIds="..UniverseId)).playing
    GetPlayingCountEvent:FireClient(Player, PlayingCount)
end)

• In a LocalScript, Change the code to

local GetPlayingCountEvent = game.ReplicatedStorage.GetPlayingCount
local PlaceId = "11287336762"

GetPlayingCountEvent:FireServer(PlaceId)
GetPlayingCountEvent.OnClientEvent:Connect(function(PlayingCount)
    script.Parent.ImageLabel.game1.PlayerCount.Text = tostring(PlayingCount)
end)
1 Like

add server script with local script? or only one of them?

HttpService is not allowed to access ROBLOX resources

i used serverscript and followed the step here is it telling me that error

local UniverseId = tostring(HttpService:JSONDecode(HttpService:GetAsync(Url.."/multiget-place-details?placeIds="..PlaceId)).universeId)

I forgot that HttpService doesn’t allow you to use roblox.com.

1 Like

what sould i do then otherwise people doesnt know anyone playing?? @Minhseu123