I don’t understand this thing, I’m creating a SENT and when the user presses E on it a menu Derma menu should show up, so I decided to use a net message to trigger the function on client-side that would create the menu. The function is being correctly called, the problem is what is happing inside it, check this code snippet:
function ENT:Initialize() MsgN(self.items) end function ENT:openMenu(len, ply) self.items = net.ReadTable() end //net.Receive(ENT.openMenu, ENT.openMenu) ignore this line net.Receive(ENT.netOpenMenu, ENT.openMenu)
function ENT:Use(activator, caller, useType, value) net.Start(self.openMenu) net.WriteTable(self.items) net.Send(self:Getowning_ent()) end
When I press E on it the net message is correctly sent to the client-side and the function openMenu is called, but I get the following error on it:
[ERROR] addons/cozinheiro/lua/entities/fogao/cl_init.lua:74: attempt to index local 'self' (a number value) 1. func - addons/cozinheiro/lua/entities/fogao/cl_init.lua:74 2. unknown - lua/includes/modules/net.lua:30
It makes no sense to me, as when Initialize is called on client-side and it correctly runs the MsgN(self.items) that prints the table items, as you can see it’s also indexing self, but no errors occurs.
Do you know why it’s happening?