Why am I asking how to identify via code if a script is being debugged?
Because of this problem:
In short, I am at a dead-end:
I cannot save data inside the DataStore while using Studio;
If I want to do this, I need to activate BindToClose and there, wait 3 seconds for the SetAsync operation to be completed by Studio, before the server is shut down;
But if I activate BindToClose, every time I stop debugging, Studio freezes 30 seconds;
The only solution, then, would be to have some instruction that identifies if Studio is in debugging. Then it would be easy: in this case, it would be enough not to execute BindToClose.
This would solve both the save within the Studio and “in-game”.
But apparently, there is no way to identify whether Studio is debugging, via code …
Serious limitation … Am I right?