Get current scope in scripting

Yep perfect, I've run a few tests and it is working much better with that in now.