Getting Random Place without any that don't exist

Hello! I’ve been attempting to create a system that will get a random string of numbers, then check if it’s a valid game and return whether it’s true or not. I’ve figured that stuff out, but what I am having trouble is optimizing the script to quickly return ONLY IDs of places that actually exist within seconds, since sometimes it can take this system hundreds of tries to work. Does anyone have any ideas?

Edit: Possible solution found, but I’m still looking for a way to only generate the place IDs without any that don’t exist. Let me know!

You can try storing those places that don’t exist in a datastore so that the next time when the random string of numbers appears, it will attempt to find another string of numbers that exists. However, you may need to let your laptop run through the numbers overtime until you can decently get a large sum of nonexistent places stored in the datastore.

Thank you so much! I could def implement this into the game. I’ll mark this as a solution for now.

If anyone can figure out a way to like, somehow only generate place IDs of games that exist though, please let me know!! I’m wondering if there is some more advanced way to do it using the API…

What’s the point of it? Let’s say you have a hundred game ID’s; you can’t differentiate anything about it. There are millions of user generated games in Roblox, and I would say a good portion of those games are starter games that ROBLOX gives a player that first starts using Studio. You would need the ID along with the name of the game and the description of it as well, perhaps even the games logo. You would basically be recreating the Roblox game page. but if you’re insistent on doing this then your best best was the solution as @Dragonfable6000 stated in a datastore.


I’m working on my own version of the RNG games on roblox called “place RNG”! It will randomly generate a place on roblox and put a rarity on it based on things like visits, age, etc.

You may also need to exclude games that haven’t been updated for 10 years.

Well, that doesn’t matter! The point of it is that you get any game on Roblox, even games that haven’t been updated in 10 years! That would just effect the game’s rarity.

I’m gonna mark this as unsolved for now since I think they’re hiding it because I marked it as solved. But if I can’t get a solution or figure on out, I’ll mark the first one as the solution again!

I found a script that works while searching through google! Yippee!

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