I want to listen to a field change in a Class Object/Instance.
The issue is that I don’t know how I can listen to a field change in a table.
The reason I need to do this is so that I know when to replicate my Object(s)/Instance(s) to the client(s) when something is changed
I have tried to Google for solutions and I have looked for solutions on the Developer Hub but I couldn’t find anything.
I Script my Classes like shown here or below if that matters
Class = {}
Class.__index = Class
function Class.new(MyField1, MyField2)
local newclass = {}
setmetatable(newclass, Class)
newclass.MyField1 = MyField1
newclass.MyField2 = MyField2
return newclass
end