function getAllItemWeight()local bagWeight = 0local keyWeight = 0local vehWeight = 0local objectWeight = 0if isElement(elementSource) then if getElementType(elementSource) == \"player\" then if inventoryItems[elementSource][\"bag\"] then for i = 1, row * column do if (inventoryItems[elementSource][\"bag\"]) then bagWeight = bagWeight + (getItemWeight(inventoryItems[elementSource][\"bag\"][\"id\"]) * inventoryItems[elementSource][\"bag\"][\"count\"]) end end end if inventoryItems[elementSource][\"key\"] then for i = 1, row * column do if (inventoryItems[elementSource][\"key\"]) then keyWeight = keyWeight + (getItemWeight(inventoryItems[elementSource][\"key\"][\"id\"]) * inventoryItems[elementSource][\"key\"][\"count\"]) end end end end if getElementType(elementSource) == \"vehicle\" then if inventoryItems[elementSource] then if inventoryItems[elementSource][\"vehicle\"] then for i = 1, row * column do if (inventoryItems[elementSource][\"vehicle\"]) then vehWeight = vehWeight + (getItemWeight(inventoryItems[elementSource][\"vehicle\"][\"id\"]) * inventoryItems[elementSource][\"vehicle\"][\"count\"]) end end end end end if getElementType(elementSource) == \"object\" then if inventoryItems[elementSource][\"object\"] then for i = 1, row * column do if (inventoryItems[elementSource][\"object\"]) then objectWeight = objectWeight + (getItemWeight(inventoryItems[elementSource][\"object\"][\"id\"]) * inventoryItems[elementSource][\"object\"][\"count\"]) end end end endendreturn bagWeight + keyWeight + vehWeight + objectWeightend