I assume you mean that you have a script that continuously loops, and you want a trigger, when activated, to make the script exit. That's fortunately easy to do.
Somewhere in your script, preferably at the beginning or end (but within the looping code), put the following code:
? StopScript : exit
Then, in your trigger's On Activation field, put the following code:
StopScript = true
Just for good coding practices, in your init.sqs script, put the following code:
StopScript = false
(This initializes the variable, and gives it a default value of false.)
Simply, the code in your script checks if the StopScript variable is true. If it is, then it causes the script to exit (stop). Otherwise, it continues.
That'll do it! Good luck.