Maybe I just need another set of eyes on this.

I’m trying to make this SENT (in this case an air tank) display its contents (self.Air) on a tooltip via a usermessage. The error message I’m receiving is:

[gamemodes\cheddar\entities\entities est_tank\init.lua:35] attempt to index local ‘self’ (a nil value)

I’ve got to be doing something wrong syntax-wise. My init.lua is posted below:\



AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
 
include('shared.lua')
 
function ENT:Initialize()
 
	self:SetModel( "models/props_c17/oildrum001.mdl" )
	self:PhysicsInit( SOLID_VPHYSICS )      
	self:SetMoveType( MOVETYPE_VPHYSICS )   
	self:SetSolid( SOLID_VPHYSICS ) 

	self.maxAir = 100	
	self.Air = 50
	self.totalAir = self.Air
 
        local phys = self:GetPhysicsObject()
	if (phys:IsValid()) then
		phys:Wake()
	end
end
 
function ENT:Use( activator, caller )
    return
end
 
function ENT:Think()

	self:tankUpdate()
    
end

function ENT:tankUpdate( self )
	umsg.Start("airTank_umsg")
	umsg.Short( self.Air )
	umsg.Short( self.totalAir )
	umsg.End()
end


it’s because you have self in the arguments, if you are using ENT: self is passed automatically without needing to be defined by having it there you redefine it as nil.

Aaah, ok. That did it. Thanks!