• All gamemode functions being called immediately on launch?
    2 replies, posted
So I started writing a gamemode this morning and I'm having a really a really bizarre issue. Basically when I launch the gamemode it immediately attempts to run every single function in the gamemode all at once despite as far as I can tell nothing calling any of them except some concommand.Adds. Side note: I disabled all addons and this is still occuring. cl_init: include( "shared.lua" ) (Yeah It's just one line for now) uploading to pastebin because the forums can't figure out how to keep this nicely formatted: shared.lua for gm init.lua for gm I don't know if those functions should be local or not as i'm not the greatest with scope and whatnot.
concommand.Add("enableschoolfreeze", enableschoolfreeze()) This is the problem. You are not giving a function reference to concommand.Add, you actually just call the function. Adding () to the end of a function calls it. (duh)
https://www.youtube.com/watch?v=FscIgtDJFXg Never before has a single sentence made me feel more braindead.
Sorry, you need to Log In to post a reply to this thread.