Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

is there something wrong with the "if aid == d" after the table loop?

       equip.MouseButton1Click:Connect(function()
            local aid = string.match(image.Image, "%d+")
            local asset = MarketplaceService:GetProductInfo(aid)
            local atypeid = asset.AssetTypeId
            print(aid)
            print(atypeid)
            print("=================================")
            for c, d in pairs (a) do
                print(d)
                if aid == d then
                    print("enter")            
                    if atypeid == 8 then
                        headi.Image = "https://www.roblox.com/asset-thumbnail/image?assetId=" .. aid .. "&width=420&height=420&format=png"
                    elseif atypeid == 43 then
                        necki.Image = "https://www.roblox.com/asset-thumbnail/image?assetId=" .. aid .. "&width=420&height=420&format=png"
                    elseif atypeid == 47 then
                        waisti.Image = "https://www.roblox.com/asset-thumbnail/image?assetId=" .. aid .. "&width=420&height=420&format=png"
                    elseif atypeid == 46 then
                        backi.Image = "https://www.roblox.com/asset-thumbnail/image?assetId=" .. aid .. "&width=420&height=420&format=png"
                    end
                end
            end
        end)

https://pastebin.com/QSpwxuDD the first line is the value of aid the lines under are the values of the table

2 comments

0

What errors are you getting?

0

there arent any errors, it just doesnt go pass the if aid == d statement, the table loop works.

1 answer

✓ Accepted answer
equip.MouseButton1Click:Connect(function()
     local aid = string.match(image.Image, "%D+")
     local asset = MarketplaceService:GetProductInfo(aid)
     local atypeid = asset.AssetTypeId
     print(aid)
     print(atypeid)
     print("=================================")
     for c, d in pairs (a) do
         print(d)
         if tostring(aid) == tostring(d) then
             print("enter")            
             if atypeid == 8 then
                 headi.Image = "https://www.roblox.com/asset-thumbnail/image?assetId=" .. aid .. "&width=420&height=420&format=png"
             elseif atypeid == 43 then
                 necki.Image = "https://www.roblox.com/asset-thumbnail/image?assetId=" .. aid .. "&width=420&height=420&format=png"
             elseif atypeid == 47 then
                 waisti.Image = "https://www.roblox.com/asset-thumbnail/image?assetId=" .. aid .. "&width=420&height=420&format=png"
             elseif atypeid == 46 then
                 backi.Image = "https://www.roblox.com/asset-thumbnail/image?assetId=" .. aid .. "&width=420&height=420&format=png"
             end
         end
     end
 end)

1 comment

0

thank you

This discussion is preserved as it was. New answers, comments, and votes are closed.