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