How to prevent Bad requests from finding place IDs

I’m working on something that will try to search for Roblox games, but it has an error saying “Bad request” very often.

	repeat
		ID = math.random(1,99999999)
		Info = Service:GetProductInfo(math.random(ID))
	until Info.AssetTypeId == 9 and not string.find(Info.Name, "'s Place")

Try wrapping it in a pcall for error handling

2 Likes