Run function on variable change.

Is it possible to execute a function when a variable changes?
For an example if a variable turns true a function would be run immedietly.

Maybe something in the form of delegates?