It was just saying Your title should be specific! Describe your problem concisely. And i didn't know what to make the title. Any way, here is the question: can you help me with this code? There are no errors in the code but it output "Bad Id"
function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
local gametp = math.random(4500000000,3999000000)
if gametp >= 0 then
local name = (game:GetService("MarketplaceService"):GetProductInfo(gametp).Name)
print(name)
print(gametp)
if string.match(name, "'s Place") then
warn("Bad Place")
local gametp = math.random(4500000000,3999000000)
else
game:GetService("TeleportService"):Teleport(gametp, player)
end
else
warn("Bad Id")
end
end
end
script.Parent.Touched:connect(onTouched)
I dont know what causes it. I tried changing
local gametp = math.random(4500000000,3999000000)
To
local gametp = math.random(3999000000,4500000000)
But it then also dont works. Got any help?
Sorry for my bad english.

4 comments
Sorry but I dont understand what is the purpose of writing this code. (Like what do you wanna achieve?) Is it a gamepass or some other function you want it to do or achieve?
It must teleport you to a random game on roblox, Like place roulette.
Im back after 4 months lol. Ok so idk if u still need help but wtv. So the problem could be that the place ID is not valid.
Plus if this a thing to tp to places there would only be places you created in the game NOT other games because what ur doing is tping to other games.