Reply To: Mafia 3 Modding (Mega Thread)
Is there any way to make a endless loop for code without crashing atm?
There is this note on M3ScriptHook mod page:
“Please be careful with pressing keys, spaming keys / executing the same things too often in a short time period can cause the game to crash!”
I made a script that executes code in a loop. To limit the rate I use setTimeout to trigger the script less often like this:
CODE TO EXECUTE … ;
Without limitation the game crashes almost instantly.
But even while waiting 1 – 5 seconds before each code exec the game crashes after a few minutes.
ScriptHook.log doesn’t tell anything about it.
Last lines of ScriptHook.log:
Trying to execute: CODE TO EXECUTE … ;