Emit events when a script is added