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

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

Asked by 4 years ago
Edited 4 years ago
       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

0
What errors are you getting? SteamG00B 1633 — 4y
0
there arent any errors, it just doesnt go pass the if aid == d statement, the table loop works. Grammar_Iy 8 — 4y

1 answer

Log in to vote
0
Answered by
iuclds 720 Moderation Voter
4 years ago
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)
0
thank you Grammar_Iy 8 — 4y
Ad

Answer this question