Using file.FindinLua

I have been trying for quite a while to get something working inside my Lua code and it is a part of a gamemode.

I am trying to access lua files inside a folder called stuff inside my gamemode folder.

I have tried quite a few things and have not been able to get it to work.
[LUA]for k, v in pairs( file.FindinLua("–/gamemode/stuff/*.lua") ) do
Msg("Loaded Item: " … v)
include(“items/”… v);

if (SERVER) then
    AddCSLuaFile("items/" .. v);


[LUA]for k,v in pairs( file.Find("…/gamemode/stuff/*"))
if string.find(v,".lua") then
I’m pretty sure that will work. I didn’t really understand what you were doing with the “items/” stuff though, so i left it out.

EDIT: Wildcard.


include( “items/” … v )

yeah, i forgot that include could work like that. Stupid me.

Finally got it to work, thanks for your help guys. I thought I would post to share what I used to get it all to work.
for k, v in pairs( file.Find("…/gamemodes/customgamemode/gamemode/stuff/items/*.lua") ) do

if (SERVER) then