I am so confused... files not working?


AddCSLuaFile()

if SERVER then
	local hide = {
		CHudHealth = true,
		CHudBattery = true,
	}

	hook.Add( "HUDShouldDraw", "HideHUD", function( name )
		if ( hide[ name ] ) then return false end

		-- Don't return anything here, it may break other addons that rely on this hook.
	end )
end

that is my init.lua,
location: addons/creation/lua/autorun
now I have tried 100s of times switching the file name, the location BUT, the server or client NEVER READS IT? like wtf. Why are my files ignored!

HUDShouldDraw is a clientside hook. You did a server check at the start

Lmao, why are you putting that serverside.

I put it serverside because it wasnt working lol…

That… makes no sense.

Ok, so my problem is my ADDON is not loading.
I had it without server
first: nothing
second: if client
third: if server
and nothing is even working!

It doesn’t just not work. You’re obviously doing something wrong.

well then I have done it wrong 18 times

its in Addons/creation/lua/autorun/init.lua
o.o

[editline]30th November 2016[/editline]

There is 0 errors
?!?!?

[editline]30th November 2016[/editline]

I did this: if there is an error please show me because this is an easy way too figure that out end
and the server didn’t show one sign of erroring. That means, the file is broken.

Its not broken. Try running your client side hook client side. /autorun/client/CLIENTFILE.lua

The file isn’t “broken” lol.

Before doing anything try printing something at the top of the file, start the server up and see if you see it.

Ok, it was because I was running it in my addons. Aka, I installed it. Never restarted gmod, thanks guys im a tool.

xD