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
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.
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)
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)