Lua Script problem

Hi, I am currently doing a card that appears when a player clicks on another.
So, I use DrawHUD for display card in client screen, and I try to do that with the left click the “hud” appears to the person who the client looks.




local carte_identite = DrawHUD()

function SWEP:PrimaryAttack()
	self:SetNextPrimaryFire(CurTime() + 1)
	ply:ConCommand( "say /me montre sa carte d'identité." )
	if !SERVER then return end
	local trace = self.Owner:GetEyeTrace()
	if trace.HitPos:Distance(self:GetPos()) < 75 then
		if trace.Entity.IsPlayer then
			self.Owner:carte_identite()
		end
	end
end


ERROR "attempt to call global ‘DrawHUD’ (a nil value)

Have you tried:



local carte_identite = DrawHUD


When Lua sees brackets next to a function, it usually expects to run it

[editline]16th May 2016[/editline]

Also, is DrawHUD defined somewhere accessible in your code already?

DrawHUD displayed on the client display an identity card
I try to ensure that at left click it appears on the client screen in front

Thank you I fix the problem