Tag change event

hello, I have a question that for some of my tags (for example, tag A) that being triggered by tag event ( in both gateway event tag change or value changed script in the tag), the tag A will reset to 0 after some period of time. the tag A is bending to a light indicator.

I think the problem is that I use tag change script, I am wondering what should I do if I just want to have a OPC tag to be always the same value of the other tag?

An OPC tag will always have the value of the subscribed device address.

If you need a tag to always be the same value as another tag, there are a few different ways to do that. Probably the easiest would be to create a reference tag and set the source tag to the tag you want to drive the value.

https://docs.inductiveautomation.com/display/DOC81/Types+of+Tags

Do you mean that you have examples of both gateway tag change scripts and valueChanged scripts?

Or do you mean that the same tag is being written from both a gateway tag change script and a valueChange script? If this is the case then, don't do that.

Usually, this means that the tag is being written from multiple directions which leads to unexpected behavior. What is the source of truth for this "TagA", if it is an OPC tag then I presume it is the connected device, in which case only that device should ever write to it.