Couldn't include file 'bhop_cfg.lua' (File not found) (@RunString (line 1))

So I made a config for making it easy to change values. It works good, but when people join they get


Couldn't include file 'bhop_cfg.lua' (File not found) (@RunString (line 1))

It makes no sense because it works but it gives errors…

Yes it’s included and added (AddCSLuaFile) to the cl and sv but it still happens why is this?

The config is like:


AddCSLuaFile()
BHOP = BHOP or {}

BHOP.Blah = "hi"

If the file is located in lua/autorun, remove the first line

it’s in garrysmod\gamemodes\bhop\gamemode

OH, then you’re supposed to include it in init.lua and cl_init.lua

I have thats the problem

[editline]8th November 2015[/editline]

Hmm do I need like something like _G?

if its a gamemode file you have to include it on ur include file (where you include all the files) with AddCSLuaFile(bhop_cfg.lua)

btw if the file is on lua/autorun you dont have to use AddCSLuaFile

Yea I know but i still have that error I used AddCSLuaFile in the init and include and also in cl_init i added the include.

What are you using RunString for? Where are you calling include?

I’m not using RunString for anything, calling include in cl_init and init


Couldn't include file 'bhop_cfg.lua' (File not found) (@RunString (line 1))

“(@RunString (line 1))”?
When the author and script disagrees with each other, you know something is wrong :v

Post the part of cl_init.lua that load the files.

You can’t include the file in CL_INIT and then add AddCSLuaFile() to that same file. Clients can’t add clientside files.

Delete the AddCSLuaFile() on the first line if you’ve already added

AddCSLuaFile( “bhop_config.lua” ) in INIT

and

include( “bhop_config.lua” ) in both CL_INIT and INIT

It’s still doing it :\ This is what I have

Init.lua


include("bhop_cfg.lua")
AddCSLuaFile("bhop_cfg.lua")

Cl_init.lua


include("bhop_cfg.lua")

Shared.lua


include("bhop_cfg.lua")

I don’t get it the errors really annoying me.

Include it on shared.lua, addcsfile shared.lua and include it serverside and clientside.
Then remove the includes of bhop config on serverside and clientside and leave it on the shared.lua

That worked but i still get this :

[FiBii-chan|20|STEAM_0:1:48688711] Lua Error:
Couldn’t include file ‘bhop_cfg.lua’ (File not found) (@RunString (line 1))

Do you get that on the client, server or both?
Also, on server side you should addcslua the file before incluiding it

Got it. It was in the wrong places lol i’m dumb.