local ents = {
GetLocalPlayer = function()
local tbl = {
localplayer = {"Ava", "1", {213,234,234}},
GetIndex = function(self)
return self.localplayer[2]
end,
}
setmetatable(tbl, getmetatable(tbl.localplayer))
return tbl
end
}
local function main()
print(ents.GetLocalPlayer()[2])
end
main()
print returns nil. If I was to do ents.GetLocalPlayer():GetIndex()
however, it returns 1.
The idea is to have the default return value to be localplayer if I don't do things such as GetIndex()