Пример простого класса

local QEngine = {}
QEngine.__index = QEngine
 
function QEngine:New(name)
  local retn = {}
  setmetatable(retn, QEngine)
  retn.name = name
  return retn
end
 
function QEngine:SetName(name)
  self.name = name
end
 
function QEngine:GetName()
  return self.name
end
 
local Q_trans = QEngine:New("Magic")
print(Q_trans:GetName())
Q_trans:SetName("Hello World!")
print(Q_trans:GetName())