Determining if an already-existing value in a table has changed

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?

Try looking at this article first. Search these problems before you make a post.

https://devforum.roblox.com/t/how-would-i-check-if-a-value-has-been-inserted-or-removed-from-a-table/222761

A similar question was asked earlier today:

1 Like