Tried doing this myself, but I’m fairly new to Lua and don’t even know where to start. I have a variable “gettinglight” set to false in the Initialize. Should I try to use the ents.FindInSphere? This is for indoor lights, by the way. a straight trace up would be a (crude) way to do it for outside, right?
I got it.
local minrange = 100
local target = nil
for k,value in pairs( ents.FindInSphere(self.Entity:GetPos(),100 )) do
local distance = value:GetPos():Distance( self.Entity:GetPos() )
if value:GetClass() == “ent_lowlight” and distance < 100 then
target = value
minrange = distance
print( “yay” )