Hello everyone, I’m relatively new to lua, and im trying to find out why my function for indexing lua files on the client.
I am trying to make a for loop that will look through all the clients files within the directory i specify. For example, I have a folder called plugins within my gamemode, this folder has sub folders, and within those folders are the server side lua (SV_BLAH.LUA) and the client side needed files (CL_BLAH.LUA) so it looks something like this:
I have it using this to send the files the client needs.
function AddDir(dir) // recursively adds everything in a directory to be downloaded by client
local list = file.FindDir(dir…"/*")
for _, fdir in pairs(list) do
if fdir != “.svn” then // don’t spam people with useless .svn folders
for k,v in pairs(file.Find(dir.."/*")) do AddCSLuaFile(dir.."/"..v) end
But I need this same method on the client to include all the files. I have tried countless things and it cant find the files. [EDIT]Also when i use that, with the gamemode directory, it only loads it for me because I have those file on my client in those directories. So don’t be fooled if you try this. [/EDIT] I need it this way to protect the plug and play method of the plugins folder… so i can just drop whatever addition I need, and not have to add includes to everything…
Also, if there is a better method to adding the files to the client then that, please tell me. Any help on this key functionality would be appreciated thank you for your time.
[EDIT 2] is there a lua highlight function for the code tags? thnx