I keep coming across an error when trying to use httpService:JSONDecode and I have no idea why it is happening! It keeps saying “Can’t parse JSON” whenever I try and run it and I have looked at about 7 different posts with the same issue but none of them worked, I validated the link btw.
here is the code:
(gameId is the PlaceId of the place)
local httpService = game:GetService("HttpService")
game.ReplicatedStorage.Events.getPlayerCount.OnServerEvent:Connect(function(player, gameId)
local result = httpService:GetAsync("https://games.rprxy.xyz/v1/games?universeIds="..tostring(gameId))
local decodedBody = httpService:JSONDecode(result).body
local active = decodedBody.data[1].playing
local maxPlayers = decodedBody.data[1].maxPlayers
game.ReplicatedStorage.Events.getPlayerCount:FireClient(player, active, maxPlayers)
end)
I’m not sure if that website even works. Proxies commonly get blocked by Roblox due to their frequent pinging of the Roblox domain. I’d recommend either using your own proxy or wait for Roblox to release their more permanent solution that they’ve hinted at a while back:
im using the new roproxy.com domain now but its saying “HTTP 404 (Not Found)” but at least when i try typing it into my browser i get a JSON response even if its an error
(btw do you know how blockate or wubby gets player counts?)