local clueCounters = {} local clueCounterGUIDS = { "37be78", "1769ed", "032300", "d86b7c" } function onLoad() self.createButton({ label = "0", click_function = "removeAllPlayerClues", tooltip = "Click here to remove all Clues from playermats", function_owner = self, position = { 0, 0.06, 0 }, height = 900, width = 900, scale = { 1.5, 1.5, 1.5 }, font_size = 600, font_color = { 1, 1, 1, 100 }, color = { 0, 0, 0, 0 } }) -- loading object references to the counting bowls via GUID for i = 1, 4 do clueCounters[i] = getObjectFromGUID(clueCounterGUIDS[i]) end loopID = Wait.time(sumClues, 2, -1) end -- removes all player clues by calling the respective function from the counting bowls function removeAllPlayerClues() for i = 1, 4 do clueCounters[i].call("removeAllClues") end end -- gets the counted values from the counting bowls and sums them up function sumClues() local count = 0 for i = 1, 4 do count = count + tonumber(clueCounters[i].getVar("exposedValue")) end self.editButton({ index = 0, label = tostring(count) }) end