#Loading Console commands automatically?

1 messages · Page 1 of 1 (latest)

sour solar
exotic gust
#

You don't need to add lua_run inside a lua file. Start from hook.Add

sour solar
#

and it didn't work

#

also i removed the lua_run from the inside file

trim sparrow
#

Try putting it in lua/autorun or lua/autorun/server

sour solar
#

Thank you guys so much i appreciate the help! it worked! 😄 @exotic gust @trim sparrow

#

how can i load lua commands automatically in gmod?
such as this one? lua_run hook.Add("PlayerDeathSound",".", function() return true end)

lethal hornet
#

maybe autoexec?

sour solar
alpine juniper
#

autoexec.exe has to be activated from properties and then general look at launch options at the bottom and put this command for it +exec autoexec.cfg

trim sparrow
#

Make your command into a script by saving it as a lua file. Then, depending on what type of script it is—client, server, or shared—put the lua file in one of the following directories below.

Shared: garrysmod/lua/autorun
Client: garrysmod/lua/autorun/client
Server: garrysmod/lua/autorun/server

sour solar
trim sparrow
#

Yeah. Make a new text document and save it as .lua

sour solar
trim sparrow
#

Np. And no, client isn't just for singleplayer. See this for a more detailed explanation: https://wiki.facepunch.com/gmod/States