Grabbing Random PlaceId

I have a random number generator that generates a placeId and checks if it’s valid. I currently have it so it will only go to a game if the game has more visits than 10k. The problem is, despite having a random PlaceId, it would sometimes bring me to Bunny Island. It does this a few times to other games as well. Teleporting to the same big games over and over again, with each random placeId being different.
Heres the randomizer func:

function TeleportService:GetRandomGame()
	local r = Random.new()
	local randomGame = r:NextInteger(1, 7317738139)
	local validGame
	
	local success, errorMessage = pcall(function()
		local getGameInfo = self.Services.MarketplaceService:GetProductInfo(randomGame)
		validGame = getGameInfo.AssetTypeId == 9
	end)
	
	if success and validGame then
		print('Game is valid, checking place data.')
		local URL = self.Container.UniversePlaceAPI .. randomGame
		local Proxy = self.ProxyService:New('https://experiencelootbox.herokuapp.com', self.Container.Key)
		local data = self.Services.HTTPService:JSONDecode(Proxy:Get(URL).body)	
		--print(data, randomGame)
		if (data.UniverseId) then
			--print(randomGame)
			self:CheckGameVisits(data.UniverseId, randomGame)
		else
			self:GetRandomGame()
		end
	else	
		--warn(errorMessage)
		--print(randomGame .. ' is not a valid place Id, please try again.')
		self:GetRandomGame()
	end
end

First things first, I suggest changing r:NextInteger(1, 7317738139) to r:NextInteger(3000, 7317738139), because most of the games before 3,000 are deleted or private.

This is a Roblox error. I used to ID surf and every once in a while I would keep subtracting game IDs and then I’d randomly end up with that Bunny Island game or the Zombie Tower game. There were a few others.

Not sure what causes it, probably a Roblox mistake that made the games popular eternally, but you can create a blacklist by getting the game name and if it’s Bunny Island or whatever then just regenerated.

Thanks. Yeah I was thinking that was weird, I guess I can blacklist those games. Surprised nobody has posted in bug reports about this or I might be blind and missed it, but thanks.

1 Like