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