AntiCrash script?


How would i make anticrash script? I need to set only cl variable to true, so i could activate my reconnect script.


You can’t prevent all crashes with simple lua line.

Well, not to prevent, but detect the crash on cl, so i could make them reconnect.

Why anticrash then?

There are several ways of doing this - one would having a variable called hasCrashed that sets to true each 45-60 seconds automatically and a net message that sets it to false each 40-55 seconds.
Then detecting if it hasn’t been set to false, then it obviously crashed.
The other way would be detecting if player can move, spawn entities and such.
Maybe you could also come up with something using:

Either way, you’ll end up doing it the ‘hacky’ way, since there’s no func like ‘OnCrash’.