Trade system won't load images/data

GIF of what happened: https://gyazo.com/e5b8e30e0bea28a54310217bf0ed858b

LocalScript that loads the trade in the incoming trade gui

local trade = game.ReplicatedStorage.Trade
local yourPlr = game.Players.LocalPlayer
local tradebox = script.Parent
local rs = game.ReplicatedStorage

trade.OnClientEvent:Connect(function(theirPlr,yourPlr,them,you)
	script.Parent.Parent.Enabled = true
	for i,v in pairs(them) do
		if rs.Hats then
			local hats = rs.Hats
			if hats[v] then
				if hats[v].ImageID then
					tradebox.Them["Them"..i].Image = "rbxassetid://"..hats[v].ImageID.Value
					tradebox.Them["Them"..i].InUse.Value = true
					tradebox["ThemRap"..i].Text = hats[v].RecentAveragePrice.Value
					tradebox.Them["Them"..i].ItemName.Value = v
				end
			end
		end
	end

	for i,v in pairs(you) do
		if rs.Hats then
			local hats = rs.Hats
			if hats[v] then
				if hats[v].ImageID then
					tradebox.You["You"..i].Image = "rbxassetid://"..hats[v].ImageID.Value
					tradebox.You["You"..i].InUse.Value = true
					tradebox["YouRap"..i].Text = hats[v].RecentAveragePrice.Value
					tradebox.You["You"..i].ItemName.Value = v
				end
			end
		end
	end
end)

local script that is sending the information

local trade = game.ReplicatedStorage.Trade
local them = script.Parent.Parent.ThemItemsMain
local you = script.Parent.Parent.YouItemsMain
local plr = game.Players.LocalPlayer

local themItems = {}
local youItems = {}

script.Parent.MouseButton1Click:Connect(function()
	for i,v in pairs(them:GetChildren()) do
		table.insert(themItems,i,v:GetAttribute("ItemName").Value)
	end
	for i,v in pairs(you:GetChildren()) do
		table.insert(youItems,i,v:GetAttribute("ItemName").Value)
	end
	
	for i,v in pairs(themItems) do
		print(v)
	end
	
	for i,v in pairs(youItems) do
		print(v)
	end
	
	trade:FireServer(plr,plr,themItems,youItems)
	script.Parent.Parent.Parent.Enabled = false
end)

script that processes the trade (server)

local trade = game.ReplicatedStorage.Trade

trade.OnServerEvent:Connect(function(plr,plr1,plr2,items1,items2)
	trade:FireClient(plr,plr1,plr2,items1,items2)
end)

why don’t the images pop up when the second gui loads (incoming trade gui) it doesnt error anything

1 Like

Could you highlight the code where you change the Image property of your ImageLabels for the second menu that pops up?

1 Like

I would recommend changing that line to this

tradebox.Them["Them"..i].Image = "rbxthumb://type=Asset&id="..hats[v].ImageID.Value.."&w=150&h=150"

Probably you’re giving a decal id instead of the image id, the thing I should work as it’ll automatically do that conversion for you

And do the same for

tradebox.You["You"..i].Image = "rbxassetid://"..hats[v].ImageID.Value

to obey the link specified for the first line I mentioned

Content Data Types

1 Like

This is where I changed the image value. By the way in the hats folder, every hat has a int value called ImageID.

Still nothing loads, I remember earlier it said that the table was empty, but I couldn’t find the solution and eventually the error just went away.

Did you add the ImageID in the properties tab of the ImageLabels?

1 Like

I am very confused with your code, mind highlighting your issue?

I don’t know where my issue is, that’s the problem. It doesn’t error, and prints aren’t helpful at this point.

If its just the Image not loading thats an issue for me too. I think its a studio bug.

Hmm, I’ll try in game, hopefully it should work then.

Try doing this with all the ImageIDs you have currently have for all the hats:

  1. Type/paste the ID into a Decal, like so:
    Screen Shot 2021-04-05 at 10.15.51 AM
  2. Press Enter, and wait for it to load
  3. Copy the NEW id that is in the Texture box
  4. Paste that into your ImageID IntValue

Also, did you say something about your table being empty? Could you elaborate?

Earlier it said that it couldn’t load an ID named “”, but then it just disappeared out of no where.

By this you mean your table or your images?

I mean this by the table, it couldn’t find an image id in it, but that was earlier, it’s gone now.

Could you show/highlight to me all your code that has anything to do with handling your tables?

Here you are. That’s all of the script that inserted the information inside of the table.

Did you mean to put plr in twice?

Yes, it is because I am sending myself the trade, so I can test it faster.

1 Like

Can’t seem to find anything wrong with the script, could you list all the values of your ImageID values that you have in your hats?

That’s a lot of values, but here:

6606883202
6606434727
6606854503
6606854283
6606434647
6606434826
6606854400
6606434547