I am not entirely sure, if this is a bug or not, but if you return a table (with functions on it) from the server to the client. All the functions on the tables will return nil. Idk why is this happening. I have a RemoteFunction that when is fired it returns a Table that has functions on it, but once it returns to the client all the functions returns to nil.
Functions can’t be serialized, so they can’t be sent over the server-client boundary. What exactly are trying to achieve? You can probably use ModuleScripts
The function
datatype can’t be shared between RemoteFunctions/BindableFunctions. I suggest you use a RemoteEvent for the server to use the function or use the module on the client.
I will be using a Private ModuleScript. I will require it from the server. The RemoteFunction once is fired is going to return the Table that the server got from the ModuleScript. Then the client will access the table with functions. (I know Private Module Scripts has been removed, but they still work if you are the owner of them).
Ok I said what I am trying to achieve above this message.
Why can’t you just require the module from the client?
When a private module script is required from the client it says: Assets can’t be load from the client
Then load it into the DataModel in edit mode?
While in edit mode, either use the toolbox or InsertService and add it to your game. Then you’ll be able to require it.
I know, but my point is so an exploiter don’t steal the code. Well, other than that, as you said in the first post
The function datatype can’t be shared between RemoteFunctions/BindableFunctions. I suggest you use a RemoteEvent for the server to use the function or use the module on the client.
I am returning a table, but not functions. The table is the one that has functions on it.
That makes no difference, nested functions still can’t be serialised. Anywho, an exploiter would be able to retrieve this function anyway.