Add a callback function to a specific event. This is used instead of hooks to avoid calling empty functions unnecessarily.
This also allows you to use certain hooks in engine entities (non-scripted entities).
This method does not check if the function has already been added to this object before, so if you add the same callback twice, it will be run twice! Make sure to add your callback only once.
function myfunc( entity, newangle ) -- Do stuff end myentity:AddCallback( "OnAngleChange", myfunc )