OnChanged( config , callback )
Allows users to create events tied to changes of a specific config.
Parameters
config
(string or list of strings): The name of the config when updated that will trigger a callback. You can provide either a single string or a list of strings.callback
(function): Function to be called upon a config update. New config value and old config value are passed to callback by default.
Usage
OnChanged
local connection = gamebeast:OnChanged({"NPCs", "Spider", "Health"}, function(newVal, oldVal)
print("New value: ", newVal)
print("Old value: ", oldVal)
end)