• How can i run my scripts in garrysmod/addons instead of garrysmod/lua?
    9 replies, posted
I want to make addons without mixing my files with the rest of the default files of garrysmod. However, when I try to put them in my addons folder they just don't run. For example lets say I have a file called hello_world.lua that prints to console. It works when the file is in garrysmod\lua\autorun\hello_world.lua but it does not work when it is in garrysmod\addons\hello_world\autorun\hello_world.lua Is there something specific I need to accomplish this?
I don't think it's still the case, but you used to have an addon text file to make GMod not ignore the folder in addons.
That didn't seem to work, I created the addons.txt from copying another one and changing the addon name. Then i put it into garrysmod/hello_world. One thing i did notice is that when i put my hello_world.lua in another addon it does work as expected. Like garrysmod/addons/other_addon/lua/autorun/hello_world.lua. Is there some kind of addon file i need to add my addon to?
AddCSLuaFile ( If you haven't done that already )
The file needs to be called addon.txt (without the s) and should have a format like this: "AddonInfo" {     "name"            "AddonName"     "version"         "Version"     "up_date"         "Date of version"     "author_name"     "Author"     "author_email"    "Email address"     "author_url"      "Website"     "info"            "Description"     "override"        "0" } If this bit has worked, you should see a line in your developer console like this: Adding Filesystem Addon '<path_to_gmod>\garrysmod\addons\hello_world'
Seems like I got it figured out, in turns out i had my folder actually named auto_run instead of autorun... x_x
If the addon is loaded correctly, the directory structure will mimic the garrysmod one and as such the automatic sending of autorun files to clients will be the same.
You don't need any text files anymore, stop spreading misinformation
somethings to know, folder/file names can have capitals or odd characters if and only if you are on windows
Sorry, you need to Log In to post a reply to this thread.