http://geck.gamesas.com/index.php/OnTrigger and http://geck.gamesas.com/index.php/OnTriggerLeave (not "OnTriggerExit") are blocktypes, just like http://geck.gamesas.com/index.php/GameMode, so should be used with http://geck.gamesas.com/index.php/Begin statements instead of being placed within existing Begin/End blocks:
ScriptName PlaySoundScriptshort DoOnceref myLinkBegin OnTriggerEnter NPCref if DoOnce == 0 set myLink to GetLinkedRef myLink.Enable set DoOnce to 1 endifEndBegin OnTriggerLeave NPCref if DoOnce set myLink to GetLinkedRef myLink.Disable set DoOnce to 0 endifEnd
I assume that you mean to http://geck.gamesas.com/index.php/Disable the http://geck.gamesas.com/index.php/Reference#Linked_Ref in your http://geck.gamesas.com/index.php/OnTriggerLeave block, but if I'm wrong just change that line back to use http://geck.gamesas.com/index.php/Enable again.
Note that you'll need to replace "
NPCref" with the editorRefID of the persistent reference that you want to be able to "activate" the trigger. If you haven't done so already, you'll also need to specify the reference that you want to http://geck.gamesas.com/index.php/Enable as the trigger's http://geck.gamesas.com/index.php/Reference#Linked_Ref.
If you want to select a random action, you'll want to use http://geck.gamesas.com/index.php/GetRandomPercent to store a random value in a variable, then check the value of that variable and decide on an action depending on its value.
Cipscis