title: Understanding classes in Lua
body: <p>I have been playing around in Lua looking to find out why and how I get a "Attempt to call field 'copy'(nil value)" when defining a "class" in Lua.</p>
  
  <pre><code>local factionClass = {}
  factionClass.Name = "throwaway"
  
  function factionClass:New(name)
      local newFaction = table.Copy(factionClass)
      if name then
          newFaction.Name = name
      end
      return newFaction
  end
  
  factionCoolguys = Faction("cool guys")
  </code></pre>