Removing First Value in Checkbox Table
snippet in lua

Removing First Value in Checkbox Table

user9102

switchCounter = 1
switchID = {}

--if checkbox-is-checked then
    switchID[switchCounter] = checkbox.id
    switchCounter = switchCounter + 1
    table.sort(switchID)

--elseif checkbox-is-unchecked then
  for p = 1, #switchID do
    if switchID[p] == checkbox.id then
      table.remove(switchID, p)
    end
  end
  switchCounter = #switchID+1
  table.sort(switchID)