Also, make sure you're not using a DLL, normal scripts can cause errors but if you load a DLL its not like a script and if it does something that is not able to be handled, buffer overflow, access violations etc it can cause the client to crash.

Do as genius_at_work says, it can stop the problem in some cases. If it does work, then check to make sure you do not have any DLLs being loaded, if so, unload the script that loads it and then try.