I'm new to gmod coding, and I'd like a bit of help with something.
Gmod detects idles using the CheckIdle() function in terrortown/gamemode/cl_init.lua, based on their viewing angle, mouse movement, and position. I'd like to, at the very least, get rid of that last method of tracking, because occasionally an idle will get crowbar pushed, and that annoyingly resets the idle timer. Ideally, I'd like to add keyboard inputs as the main way that idleness is tracked.
That said... I don't really want to just edit the cl_init file, because if I start changing the gamefiles themselves I'll eventually lose track of the changes I've made. I'd rather somehow have the change be an addon in the addon folder. But I don't know how to override GM functions (or, more generally, I'm not too clear on inheritance and file-structure shenanigans in general).
Any tips on how I can override a GM function in addons? Is there a better way of doing this that I don't know about? Pls be gentle.