Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How To Detect If A Product ID I Chose Randomly Is The Id Of A Game Or Not Or A Model Id?

Asked by 3 years ago

Random ID Generator:

local MPS = game:GetService("MarketplaceService")
while true do
    local Numbers = nil
    local ImageID = Instance.new("StringValue", script.Parent)
    for i = 1, 7 do
        Numbers = math.random(0,9)
        print(Numbers)
        local NumberValue = Instance.new("NumberValue", script.Parent.Numbers)
        NumberValue.Name = i
        NumberValue.Value = Numbers
    end
    for i,v in pairs(script.Parent.Numbers:GetChildren()) do
        ImageID.Value = ImageID.Value..v.Value
    end
    script.Parent.Numbers:ClearAllChildren()

    local Asset = MPS:GetProductInfo(ImageID.Value)

    script.Parent.Image = 'rbxassetid://'..ImageID.Value and Asset.IconImageAssetId
    script.Parent.Parent:WaitForChild('IdOfImage').Text = 'ImageId: '..ImageID.Value
    script.Parent.Parent:WaitForChild('NameOfImage').Text = 'Image Or Player Or Game Or Asset Name: '..Asset.Name
    ImageID:Destroy()
    wait(5)
end

Answer this question