Table function calling itself as "self"

I have a item table Called ITEM which contains another table called Sound

ITEM.Sound = {
    male = {
    female = {

ITEM.OnUse = function(ply)
    return false

Now when I am trying to use this item, it returns me this error:

[ERROR] path/to/gamemode/items/item.lua:31: attempt to index global 'self' (a nil value)

What am I doing wrong?

self is nil inside of ITEM.OnUse: it’s not a meta function.

How would I be calling the Sound table then from within ITEM.OnUse?

Call it outside the function with a hook, make your table there…

What addon are you using/what is ITEM referring to?

Is ITEM.OnUse = function(self, ply)
function ITEM:OnUse(ply) MsgN(self)

ITEM is a table created to insert items (bread, healthpacks, cars) into the game.

I tried gonzalog’s solution with extending the basefunction of OnUse. Means I added a reference back to itself, from where I call the the function OnUse.

Thanks everyone!