• Including files issue ( clientside )
    1 replies, posted
Hello I am having some troubles with including files ( client side ). Folder structure: verycooladdon lua autorun "verycooladdon_autorun.lua" verycooladdon "cl_verycooladdon_init.lua" I am doing this: -- inside the autorun file if SERVER then -- some server code that isn't relevant else AddCSLuaFile("../verycooladdon/cl_verycooladdon_init.lua") -- didn't fix the problem if CLIENT then include( "../verycooladdon/cl_verycooladdon_init.lua" ) end -- (line 25) to include another file which is not in the autorun folder end And I am getting this error: [leeroy|4|STEAM_0:1:000000] Lua Error: Couldn't include file '..\verycooladdon\cl_verycooladdon_init.lua' (File not found) (@addons/verycooladdon/lua/autorun/verycooladdon_autorun.lua (line 25)) The "cl_verycooladdon_init.lua" file is not empty. As I read on the wiki that "If the file you are including is clientside or shared, it must be AddCSLuaFile'd or this function will error saying the file doesn't exist.". So I did that, but it didn't work. This is just me being dumb again, but I literally have no clue. Any suggestions?
AddCSLuaFile and include are both relative to either /lua/ or the directory it was called from. Remove the `../` and it should work.
Sorry, you need to Log In to post a reply to this thread.