Hello all, I am having some difficulties trying to create a function that when called will reset my board game and also reset the Character Sheet back to its default values. I have 2 character sheets in my game each with its own unique GUID. By the way I am using the wonderful Character sheet created by MrStump from the workshop, its excellent. I have part of it working and that it currently resets the text entry field when the function is ranned, but however I can't get it to reset the counters as well. I will show a pic of what I am referring too:

[url=https://postimg.org/image/tkpu6e5ph/][/url]

Somehow it's messing up. I want to get the counters to reset back to 0 when the function is ran. I would like to combine this into 1 function, currently I made another function called 'resetcounterbox' to experiment and see if I can make this work. This is what I currently have:

Code:
function newGame(o, color)
  if color=="Black" or Player[color].promoted==true or Player[color].host==true then
    findDeck()

    sheet = getObjectFromGUID('05424e')
    sheet2 = getObjectFromGUID('e4432e')

    local inputs = sheet.getInputs()
    for k,input in ipairs(inputs) do
      sheet.editInput({index = input.index, value = ''})
      sheet2.editInput({index = input.index, value = ''})
    end
    resetcounterbox()
else
  end
end

function resetcounterbox(o, color)

  sheet = getObjectFromGUID('05424e')
  sheet2 = getObjectFromGUID('e4432e')

  for i, data in ipairs(ref_buttonData.counter) do
      ref_buttonData.counter[i].index = spawnedButtonCount - 1
      --Sets up label
      local label = data.value
    sheet.editButton({index = data.index, value = ''})
  end
end
Could someone help me combine the resetcounterbox function into the newGame function. Thanks in advance.