Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

is there a way to show the amount of players in another game?

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!

1 comment

0

Contact me on discord : Vitrox#0329

2 answers

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.

5 comments

0

hmm.. wouldn't a table suffice? even if i tried this, im trying to see a main game's player count through a main game so, it wouldnt work really lol

0

So you're trying to get the current games playercount or?

0

Oh wait i get what you mean, I'll look into it a second.

0

Why don't you just use apis?

0

Well you can it's just that you can't use ROBLOX's API without using a proxy.

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=

Anyway, hope this helps,

If it does, please press the Accept Answer button, Tweakified

This discussion is preserved as it was. New answers, comments, and votes are closed.