.cfg scripts, anyone?

Since everyone in Gmod uses Lua and this subforum is also about Lua, I don’t know where should I ask about the .cfg scripts. I want to be able to bind keys fast, don’t know if that can be done in Lua and didn’t find any guides about .cfg in Gmod.
I’d like to have a single button to activate many binds, I made it by making the pressed button execute a selected .cfg with many binds inside. But that way the binds get added to config.cfg and I don’t want that. Ideally the binds should only be active while playing a gamemode of my choice. I’d also like messages displayed only on my screen when I press certain buttons. I’ve seen some tf2 guides, where either the script is outdated and no longer works, or the text gets displayed on everyone’s screen. Can I do that, how can I do that, and if this is not the right place to ask, where should I?

Single bind multiple commands
bind <key> “command 1 ; command 2 ; etc”
Run specific .cfg
bind <key> “exec commands.cfg” (can’t remember if you need the .cfg)
You cannot display text on only you’re own screen.

for the gamemode binds, you can’t do that with just cfgs, the closest you could get would be to run


host_writeconfig default

with your default binds, then set all the binds you want for the gamemode and do


host_writeconfig gamemodename

but since lua can’t call exec, you would have to either type “exec gamemodename” for each gamemode or bind keys

for the messages, the only way I can think of would be turning developer 1 on and using echo, or binding a key to [lua]lua_run_cl LocalPlayer():PrintMessage(HUD_PRINTCENTER, ‘whatever’)[/lua], but that will only work if the server has sv_allowcslua set to 1