I got something to fix today. So I have these pairs statements:
for _,v in pairs(LocalPlayer().PocketData) do for k, weapon in pairs( LocalPlayer().PocketData ) do if weapon.weapon == v.weapon then -- Create DPanels for DIconLayout end end end
But when I have 2 of the same weapon in my table it shows 4 of them instead of 2:
So this is my table ( fetched from sql when player joins and put into table )( This is the PocketData Table ):
1: steamid = STEAM_0:1:28792222 weapon = m9k_m3 id = 18 2: steamid = STEAM_0:1:28792222 weapon = m9k_m3 id = 19
Then this is my DPanels which are now duplicated for some reason when there is only meant to be 2 weapons ( from table ):
When I click on Drop ( a command I made using DermaMenu() ) It removes only one from the table. This means that there is a fault with my displaying code above
So how do I resolve this problem of duplicating items?