Imagine a Flower object with a preset growth of 5.
function Flower.new(o)
local newFlower = {}
setmetatable(newFlower, Flower)
newFlower.Growth = 5 --
return newFlower
end
If Growth did not previously exist, you could check for a new index using the __newindex metamethod. However, in my example, it already exists. So if the growth value already existed and was changed, how would you setup a function that fires on the change?