Help with my gamemode, Clients Crash with Access Error


I am scripting a Gamemode and both gamemodes I have created crash the client to desktop with the error in the dump:

Process Arch: x86
Exception: 0xC0000005
Info: The thread tried to read from or write to a virtual address for which it does not have the appropriate access.

The funny thing is that only one thing is in common between the two gamemodes, the code to show the hands. However, I have tried commenting the code out and the issue still persists. The addons are fine as I have tested them in singleplayer with no crashes, but when I test the gamemode on either the srcds server or my singleplayer client it always crashes with this error. The interesting thing is that it doesn’t crash at any specific time. It doesnt crash if something specific happens or due to a specific time, it just randomly crashes clients to desktop. It is not just my game as it crashes my friends games too. I have tried looking into this error before and there has been no real solutions other than disable addons (which I have done and it still happens).

I have left a link to my gamemode here:

The server never gives any errors and doesnt crash, leading me to believe it is part of the client-side code but I don’t know what bit is causing it. Thanks.

Are you sure it’s not just crashing your client?

You are creating fonts inside HUDPaint. Move them to the top of your file.

Thank you so much! I have been trying to fix this for a while, you have saved me a load of work. I can’t believe it was something that small causing the game to crash to desktop xD