4
I wonder why it is not returning a table in the code I made:
TP = {}
function TP:new(pos, newpos, effect)
return setmetatable({pos = pos, newpos = newpos, effect = effect}, { __index = self })
end
function TP:setNewPos(position)
self.newpos = position
end
function TP:setEffect(efeito)
self.effect = efeito
end
var = TP:new({x = 160, y = 54, z = 7}, {x = 180, y = 60, z = 7}, 10)
print("is "..var.newpos) -- era para retornar uma tabela.
strange thought that POO in LUA would be possible to return a table without using pairs or ipairs... in the case POO only serves to make changes in variables within the function... anyway, thanks! + 1
– vodka