Finding games by a script

Hey,
I am working on a game for smaller developers to promote their game for free.
Now that I’ve made the scripts, the leaderstats and some other stuff, I realized that I don’t know how to actually make the game joinable over another game, but I do know how to teleport players into another places.
So the real question is how do I make it so the game automatically knows what games the user owns and how do I make it so the game finds another game just by its id?
I’ve already tried to find a solution on YouTube and here, but I didn’t find anything.

Also I just need an explaination, not a script, as it’s not allowed to ask for entire scripts.

Any help is appreciated.

(By the way this is my first post here so if you have any feedback on what I could do different next time please tell me.)

1 Like

maybe you could somehow make it so you check what games the player has and then just do what you wanna do.

Make a GET request to this url

https://games.roblox.com/v2/users/{YOUR_USER_ID}/games?accessFilter=2&limit=50&sortOrder=Asc

This will return the specified user’s created games as a json table

Also a quick tip to find APIs on any website on google chrome

For example if you want to get a game’s visits count, go to the game’s url, open the chrome developer tool and go to the network tab. Refresh the page and search for the data you are looking in the network section. It will show which url you should make a request to in the request details.

My best go-to solution would probably the roproxy API or whatever API you find the best for you , I believe you can find lots of explanations on how to use it on the devforum.

My proxy tutorial can help

I did everything but when testing the game it says

Put the http module inside server storage and get it with require(directory)

Well that’s the thing I’m trying to get an explaination of

Thank you that worked but then I tried to put the id u talked about above and now it says this:
image

Are you sure you are using the proxy link? Make a request to the proxy not the roblox resource

Am using this link: “https://games.roblox.com/v2/users/{YOUR_USER_ID}/games?accessFilter=2&limit=50&sortOrder=Asc ”.
I pasted it in here:
image

Can you share the module and the full script?

The Module Script (HTTP):

local HttpService = game:GetService("HttpService")

function http.getasync(targetURL)
	local proxyURL = "https://games.roblox.com/v2/users/{YOUR_USER_ID}/games?accessFilter=2&limit=50&sortOrder=Asc "

	local query = "?q=" .. HttpService:UrlEncode(targetURL)
	local response = HttpService:GetAsync(proxyURL .. query)
	local decodedResponse = HttpService:JSONDecode(response)

	if decodedResponse.result == "success" then
		return response
	else
		return "Error fetching data:", decodedResponse.error
	end
end

return http

The script in the ServerScriptService:


print(http.getasync("https://users.roblox.com/v1/users/424762688"))

Edit: Also I’ve changed YOUR_USER_ID to mine but I’ve copied the text before changing it

Replace with your proxy url, not the api

But when I do that it’s just showing the stats like username, join date etc

Because you entered the api link for profile data

So am supposed to change it in the Script in the ServerScriptService?

1 Like

yes change the link to whatever api you want

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.