@smallg
Let me start by saying thank you for the script. I think I understand most of it. Lua drives me nuts with it's strange sequencing of command placement but I am slowly catching on.
Info: what I have is one light (entity no. 149) named thunder light to turn on and off. I have one trigger entity named burned wood laying on the beach
(entity number 159)
Problem: When the program starts there is an immediate flash (not sure about the flash) followed by a clap of thunder and the trigger entity (159) has vanished from the beach.
I have attached the current copy of your script which I am using noting a few revisions.
Edit : Solved the problem of the trigger vanishing. remarked the lines that hide the trigger (159) entity. Now the first time getting near the now visual trigger the thunder and lighting works just as I had envisioned.
The only thing is, the trigger entity will not function again beyond the first instance. See the video...
New edit @ 21:24 my time:
Believe it or not, I fixed it. Attached is the final script for your approval. Thank you for everything.
Windows 10,64 bit|AMD FX-6200 Six-core-3.80 Ghz |CPU PASSMARK 6,142 |Memory 10GB |NVIDIA GEFORCE GTX 660 SC |GPU PASSMARK 4,114