I suggested something like this
Lua Code:
local currency = {}
local function getCurrencies()
if not OrderHallCommandBar then return end
local prevName
for better scoping (and resetting) of variable prevName.
For me it feels like
Lua Code:
if not currency[name] then
should be the first check within loop, with isWatched setting visibility and order.
I think
Lua Code:
else
currency[name].text:SetText(count)
end
is missing code relating setpoints and prevName.