Im making a wayback machine game where you can quicky teleport to old games, and i’m halfway done with it. I have the ID validation, GUI’s and teleportation all figured out. When i request a new game, sometimes i get an asset not a game. Is there a way to check if it’s a game? Any type of help is appreciated.
Here are the scripts i made so far:
server script
local MPS = game:GetService("MarketplaceService")
local information
local event = game.ReplicatedStorage.event
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
char.Humanoid.WalkSpeed = 0
char.Humanoid.JumpHeight = 0
end)
end)
local id = math.random(200, 5000)
local success, error = pcall(function()
information = MPS:GetProductInfo(id)
end)
if success then
print(information.Name)
local title = information.Name
local image = "rbxthumb://type=Asset&id="..information.AssetId.."&w=150&h=150"
event:FireAllClients(title, image)
else
print(error)
end
local script
local event = game:GetService("ReplicatedStorage").event
event.OnClientEvent:Connect(function(title, image)
script.Parent.TextLabel.Text = title
script.Parent.ImageLabel.Image = image
end)
By the way, my temporary solution is requesting a new game. Don’t think its relevant though, because my goal is to make only games show up.