# System function calls not recognized from Timer Script Function

**URL:** <https://forum.inductiveautomation.com/t/system-function-calls-not-recognized-from-timer-script-function/67301>\
**Category:** Ignition\
**Tags:** ignition81, scripting, perspective\
**Created:** [December 6, 2022, 4:55pm UTC](https://forum.inductiveautomation.com/t/system-function-calls-not-recognized-from-timer-script-function/67301 "2022-12-06T16:55:10Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [December 6, 2022, 5:07pm UTC](https://forum.inductiveautomation.com/t/system-function-calls-not-recognized-from-timer-script-function/67301/2 "2022-12-06T17:07:42Z")

</div>

This is due to some very long standing scoping issues.

> [@Global Variables are not recognized in functions in "Gateway Events Scripts"](https://forum.inductiveautomation.com/t/global-variables-are-not-recognized-in-functions-in-gateway-events-scripts/31856/2):
>
> This is not really a bug, but it is annoying. Gateway event scripts use legacy python scope rules that prevent any names in the top level event scope from being captured in nested functions’ closures. (Ignition v8 would have been a good choice to drop the backward compatibility…) If you find you need to define a nested function within a gateway event script, you probably should move the whole thing to a project script module. Then your gateway event becomes a one-liner, something like so: […

Place your code in a function in a script module and then call that script from the Gateway Event.

---

_[View the full topic](https://forum.inductiveautomation.com/t/system-function-calls-not-recognized-from-timer-script-function/67301)._
