fork download
  1. TP = {}
  2. function TP:new(pos, newpos, effect)
  3. return setmetatable({pos = pos, newpos = newpos, effect = effect}, { __index = self })
  4. end
  5. function TP:setNewPos(position)
  6. self.newpos = position
  7. end
  8. function TP:setEffect(efeito)
  9. self.effect = efeito
  10. end
  11.  
  12. var = TP:new({x = 160, y = 54, z = 7}, {x = 180, y = 60, z = 7}, 10)
  13.  
  14. print ("is")
  15. for chave, valor in pairs(var.newpos) do
  16. print (chave, valor)
  17. end
Success #stdin #stdout 0.01s 2496KB
stdin
Standard input is empty
stdout
is
y	60
x	180
z	7