• include("folder/file.lua") doesn't work
    10 replies, posted
Here is my addon files structure: lua/autorun/client/myproject_autorun.lua lua/myproject/console_variables.lua lua/myproject/default_definitions.lua lua/myproject/flags.lua lua/myproject/language.lua lua/myproject/presets.lua lua/myproject/proxies.lua here is myproject_autorun.lua content: AddCSLuaFile() AddCSLuaFile("myproject/language.lua") AddCSLuaFile("myproject/default_definitions.lua") AddCSLuaFile("myproject/presets.lua") AddCSLuaFile("myproject/flags.lua") AddCSLuaFile("myproject/console_variables.lua") include("myproject/language.lua") include("myproject/default_definitions.lua") include("myproject/presets.lua") include("myproject/flags.lua") include("myproject/console_variables.lua") However, the game complains that there are no such files, and so the code doesn't work. What am I doing wrong?
Do you want to send the files from the server to the client?
Uhm yes, though it's planned to publish addon into workshop. Tried commenting out AddCSLuaFiles, didn't help
i remember a bug of sorts where it would send an empty file and the client would whine about it not existing
you think AddCSLuaFile puplish a addon to the workshop?
And how it's related for now? All included files are not empty
your last message sounded like it. because if you do, its not true...anyway to the problem, you run the AddCSLuaFile clientside. Which is possible, but not what you need..you need to do the AddCSLuaFile serverside
The game still complains that cannot include those files!
ok, how big are these files?
413b myproject_autorun.lua 1,8Kb console_variables.lua 2,1Kb default_definitions.lua 1,4Kb flags.lua 3,1Kb language.lua 12Kb presets.lua 3,9Kb proxies.lua
Was about to post this. You were calling AddCSLuaFile() on the client instead of the server because the file was in 'autorun/client'.
Sorry, you need to Log In to post a reply to this thread.