# Regarding Gateway Event Script - Tag Chabge

**URL:** <https://forum.inductiveautomation.com/t/regarding-gateway-event-script-tag-chabge/102950>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [February 26, 2025, 11:00pm UTC](https://forum.inductiveautomation.com/t/regarding-gateway-event-script-tag-chabge/102950 "2025-02-26T23:00:19Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [February 27, 2025, 1:19am UTC](https://forum.inductiveautomation.com/t/regarding-gateway-event-script-tag-chabge/102950/6 "2025-02-27T01:19:53Z")

</div>

Please properly format the stack trace, see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831).  
It makes it easier for others to read. You can edit your post by clicking the penicl icon in the bottom right.

As for the cause:

> [@Rakesh\_Parmar](#):
>
> global name 'socket' is not defined

It seems that its not happy with your use of `socket`

You should define this script in the scripting library of this project. There are some weird behaviors (most notable is the need to `import system`) with contexts in the event scripts.

These are almost always corrected by defining the script in the script library and calling the function from the event script.

---

_[View the full topic](https://forum.inductiveautomation.com/t/regarding-gateway-event-script-tag-chabge/102950)._
