Addon : gmod not run my init.lua

Hello world,

I try to update my addon into 1 file includes all other files but I have a problem.

I make in my addon : “PulpMod/lua/pulp/init.lua” but it don’t work.

Why ?

Thanks for answer :smiley:

Do you have an info.txt? If not, just borrow one from a different addon folder and put it in yours. Also, your grammar is pretty bad.

“lua/pulp/” gmod doesn’t automatically load files from there.
(As far as i know.)

Sorry for my bad english : I’m french :smiley:

But I have info.txt and the content is :

As creec said, the problem is that GMod looks for init.lua in /lua/ and nowhere else.

Your pulp entity path should be: addons/PulpMod/lua/entities/pulp/init.lua

I see with the ulx admin mod :

ULX/lua/ulx/init.lua and this work but for me, don’t work :confused:

Why ?

ULX has an init file which loads the ulx folder

GMod->Loads - lua/autorun/ , lua/autorun/server , lua/autorun/client

lua/autorun/ulxinit.lua->Loads - lua/ulx

If you so want it to be loaded from “PulpMod/lua/pulp/init.lua” then make a "“PulpMod/lua/init.lua” with:



include("pulp/init.lua")


Thank you. I try now your answer :smiley:

i know this is kindof off topic from this forum but i am wondering can someone tell me about include what does it do exactly. does it cause a file to run or just enable it and its hooks. (this may sound wrong because i just started gmod lua a few months ago). also does init.lua run automaticly. i think it does but and dont want to spend much time pulling hair out over thease issues

You started a couple months ago and you don’t know what include does…?

creec is wrong, dont listen to him.

Place a file in lua/autorun/pulpmod.lua

It will load the code there

If you prefferr you can do this:
include(“pulp/init.lua”)
in the file to load pulp/init.lua

What part of me is wrong?
What you told is different thing.

[editline]05:07PM[/editline]

Or maybe i AM wrong indeed. I was mixing the way gamemodes and addons are loading lua.
Excuse me.

Yes you are, you put a init.lua file in the root lua directory and see if it loads.

Well i’m still proud of myself. I easily admitted my defeat.