I can't make any more addons, they are just not loaded !
9 replies, posted
Hi..
I can't make any more addon w/e i'm doing the files are not loaded, however if i modify old addons it's working fine... For exemple if I create a folder in addons named 'test' with inside a test.lua with for exemple :
hook.Add( "OnPlayerChat", "HelloCommand", function( ply, strText, bTeam, bDead )
strText = string.lower( strText ) -- make the string lower case
if ( strText == "/hello" ) then -- if the player typed /hello then
print( "Hello world!" ) -- print Hello world to the console
return true -- this suppresses the message from being shown
end
end )
It doesn't work... However if i put this in any of my previous addons it does work
I'm lost :/ That's very weird... I tried restarting server like 15 times but nothing changed. Lua refresh is working fine i can add code to my previous addon like said above and the changes are done but i can't create any .lua, they are just not loaded...
Does anyone have an idea pls?
How many server addon folders do you have exactly?
17 exactly. I tried to remove 'swep construction kit' and add it again and it worked. However if doesn't work with the test i mentioned before...
Why would I ? I created that into "addons" => "test" => "lua" => test.lua and it's not working at all
needs to be:
client: /addons/<addon>/lua/autorun/client/<file>.lua
server: /addons/<addon>/lua/autorun/server/<file>.lua
OR
you can have it your way if you include a script in the autorun folder which addcsluafiles and or includes ur shit.
Any .lua must in a autorun folder ?
I'm using glua since about 2 month now and i was not aware of this.
So basicly it's kind of normal for my code to not be loaded ?
not all lua files needs to be in autorun folder, but, you will need to manually addcsluafile/include your files if you don't put them in there.
May I ask a last question
i don't understand when I should use include & when i should use addcsluafile, i did read the doc but i don't see the difference
Sorry, you need to Log In to post a reply to this thread.