Skip to content

Welcome to the official exechack.cc api!

Lets start with the main thing, exechackapi is an addition to the standard API for developing addons(GLUA).
https://wiki.facepunch.com/gmod

there are 2 types of scripts, 1 popular - client, and menustate.

To run clientside name *.lua, for menustate name *.luamenu.
To autorun lua, add *_autorun.lua to the name.

dangerous functions are available in menustate that can change files on your computer, so launching in menustate is only possible with a cheat or changing game files, which the server cannot do.

client scripts work in the same environment with addons and this environment is limited so that the creators cannot harm you.
but in the environment menustate you can interact with the cheat menu and run scripts on the client environment through the function runtoclientside.

An example of the simplest script with the interaction of the menu and cfg cheat with launch on the client:

1
if IsInGame()then Derma_Message("run only in main menu","1","OK")return end
if exec_cfg_GetValue("PRINTONSPAWN")==nil then
	exec_cfg_SetValue("PRINTONSPAWN",false)
end
exec_addclientcodetoautorun("printserver",[[
if exechack_api.cfg_GetValue("PRINTONSPAWN")then
	print(1)
end
]])
exec_menuaddtab("my tab",function()
	exec_menuaddcheckbox("print 1 on spawnserver",15,30,"PRINTONSPAWN","description")
end)