Script enter and exit events