(Server Code)
remote.OnServerInvoke:connect(function(player)
local obj = { name = "memer"; foo = function(self) print("Hello, world!") end }
return obj
end)
(Client Code)
local obj = remote:InvokeServer()
print obj.name
obj:foo()
The output will print obj.name as "memer" but will then say something like foo is not a member of obj and will fail execution. I tried to execute obj:foo() on the server and it executed successfully but after being sent to the client it seems to keep its properties but not its functions. Is this a bug or something inherent to remote functions / tables and is there anyway to get around this?
Thanks :)

2 comments
Functions cannot be sent in remote objects.
OnServerInvoke is a callback function, which means you cannot hook it to an event like that. You have to do "function remote.OnServerInvoke(player) end"