lua code for function in map

Hi all;

I want to create a function in my map that can toggle a door, lights, move_linear, func_traintracks by a gmod glua command. Is that possible, and how would I do that?

Thanks in advance!

Yes, you can. Here’s an example.