• can not include my file?
    9 replies, posted
my config is here https://i.imgur.com/FvV0qrM.png the error is https://i.imgur.com/b2ezuvv.png my lines are AddCSLuaFile("Essentials_Config.lua") include("shared.lua") include("Essentials_Config.lua")
It looks like you are calling AddCSLuaFile("Essentials_Config.lua") from a clientside script. This needs to be called serverside so the file will be sent from the server to each client (player) that joins the server. You can then use include clientside to run that file.
so should i just do if SERVER then AddCSLuaFile("Essentials_Config.lua") end
If the file that code is from is cl_init.lua then that whole script will never be run serverside. You can put it in init.lua or shared.lua. The function AddCSLuaFile doesn't cause errors but instead does nothing when run clientside.
im not understanding what your saying i have my hud inside, lua/autorun/cl_main.lua then i have my bank armory inside lua/entities/tog_policearmory then inside there i have init.lua cl_init.lua shared.lua
You've already asked this and I told you it's because it's not in the same folder as the init.lua so it can't find it you need to give it the file path so it'd be include("lua/Essentials_Config.lua")
i fixed everything nvm i understood you
include will also look for paths relative to the /lua directory, if it can't find a relative path to the current one, so this shouldn't be the cause of the issue. Your AddCSLuaFile("Essentials_Config.lua") needs to be put in init.lua. You can then put include("Essentials_Config.lua") in your cl_init.lua and/or init.lua
so its including the hud but not the bank armory will you take a look and when you fix it go through it with me? https://www.dropbox.com/s/wqp6jt36hvf7hkt/TOG_essentials.zip?dl=0
My first suggestion is that you rename the config file for the armoury from config.lua to something like TOG_armouryconfig.lua. You also need to add an AddCSLuaFile call in init.lua since this is not being downloaded at the moment. The top of cl_init.lua should look like this: include("shared.lua") include("TOG_armouryconfig.lua") The top of init.lua should look like this: AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") AddCSLuaFile("TOG_armouryconfig.lua") -- This is the line you were missing include("shared.lua") include("TOG_armouryconfig.lua") I'd also suggest changing the name of the hud_config.lua file to something a bit more unique like TOG_hud_config.lua since other (badly named) scripts could interfere.
Sorry, you need to Log In to post a reply to this thread.