#Loading Console commands automatically?
1 messages · Page 1 of 1 (latest)
You don't need to add lua_run inside a lua file. Start from hook.Add
I have put it at here as test
and it didn't work
also i removed the lua_run from the inside file
Try putting it in lua/autorun or lua/autorun/server
Returns whether or not the default death sound should be muted.
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)
maybe autoexec?
I have tried doing it in there and it didn't work
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
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
how can i make it as lua file to name it at the end .lua?
Yeah. Make a new text document and save it as .lua
alright thanks and last thing client means for single player right?
Np. And no, client isn't just for singleplayer. See this for a more detailed explanation: https://wiki.facepunch.com/gmod/States