Lua Entity:Fire for map logic relays issue.

Hi, made this system with atmos (In atmos init.lua). When I start the server I get this error (for all :Fire’s)




[ERROR] addons/dnc/lua/atmos/init.lua:395: attempt to index field 'Lua_Night_Lights_Off' (a nil value)

  1. func - addons/dnc/lua/atmos/init.lua:395

   2. fn - addons/dnc/lua/atmos/init.lua:185

    3. unknown - addons/ulib/lua/ulib/shared/hook.lua:110






		-- Custom calls for our blackmesa map, vingard.

		local M = ents.FindByClass( "logic_relay" )

		if ( self.m_Time >= TIME_DUSK_END ) then

	                self.Lua_Night_Lights_On:Fire( "Lua_Night_Lights_On", "", 0)
		self.Lua_Night_SpotLights_On:Fire( "Lua_Night_SpotLights_On", "", 0)

		end

		if ( self.m_Time >= TIME_DAWN_START ) then

		self.Lua_Night_Spotlights_Off:Fire( "Lua_Night_SpotLights_Off", "", 0)
		self.Lua_Night_Lights_Off:Fire( "Lua_Night_Lights_Off", "", 0)

		end



All help is appricated thanks.


self.Lua_Night_Lights_On

does not exist then.

And what are you doing with


local M = ents.FindByClass( "logic_relay" )

I don’t see it used anywhere

Ah, that was me testing something out before. So, the

Lua_Night_Lights_On must be the entity name for it to work?

Thanks.