title: How to create new data types on Lua code?
body: <p>I've searched the web, but no tutorial really made it clear to me, so I need a brief explanation on this:</p>
  
  <p>I want to create new data types for lua (in the <strong>C</strong> language compiler) for creating values like:</p>
  
  <pre><code>pos1 = Vector3.new(5, 5, 4) --Represents 3D position
  
  pos2 = CFrame.new(4, 2, 1) * CFrame.Angles(math.rad(40), math.rad(20), math.rad(5)) --Represents 3D position AND rotation
  </code></pre>
  
  <p>These are some lines I could ordinary use on a game engine called Roblox. I want to recreate them for using outside Roblox.</p>