hello! i've been working on a game that is essentially a lobby that teleports to other games.
now, these games could be anything. so i was wondering; is there a way to see the amount of players in another game?
i feel like this would be helpful for a player who wants to know if the game he's going to even has any players. help would be appreciated!
Hello well I searched for method's but the only method I've found was if you're making a game like "Main game" then the servers in that or i mean like a GUI you can maybe count the players joining / leaving it? Well the joining i get but leaving not sure, maybe a datastore to update the player count and get it thru there? Try a datastore. I've never seen this question before and I'm curios for the answer as well.
Hello,
You can do this very easily with the HttpService using a webapi
The games api does this perfectly.
To do this ingame, you could do something like:
local HttpService = game:GetService("HttpService") local universeId = 445 -- change to your own place universe id local response pcall(function() response = HttpService:GetAsync("https://games.rprxy.xyz/v1/games?universeIds=".. universeId) end) if response ~= nil then local data = HttpService:JSONDecode(response) local playing = data["data"][1]["playing"] print(playing) end
You have to use a roblox proxy because otherwise, you will get a "Trust check failed" error
A universeId is not a placeId. There is a distinct difference. A placeId is the id for the entire game, as you can have multiple places inside one game. A universeId is the id for a place inside the game.
Tonge twister, I know.
You can get these universeIds with another api service: https://api.roblox.com/Marketplace/ProductInfo?assetId=<placeId>
Anyway, hope this helps,
If it does, please press the Accept Answer button, Tweakified