Need help... include()

Hey I’m making addon (client side). I have 2 lua files.
lua/autorun/client/run.lua
lua/data/cl_check.lua

I want run cl_check.lua by run.lua. How can I do it.


include("../../data/cl_check.lua")

didnt worked.

I don’t think you can go up directories.

Have you tried

[lua]RunString( file.Read( “data/cl_check.lua”, “LUA” ) );[/lua]

If you use that, then I’m pretty sure you can’t use include within that script. So give me a few minutes to think.

When using include, remember that it’s normally used for mounted addons. When an addon is mounted, it merges all the files inside the “lua” folder to the garrysmod/lua folder, so when you do stuff like include(“testfile.lua”), it’s actually looking inside garrysmod/lua/testfile.lua

You can. I’ve done it before. Works flawlessly.