What can be returned back with remote functions?

What kind of information can we return from server to the client? Say for example, the player presses a button, which invokes the the server to send a copy of a local script back to the player? Can we in this instance, return a copy of the local script to the player? I tried this to no avail. Output either gives me an error or nil. So I ended up handling the parenting of the local script through the server. From what I’ve tested, I could only return bools and strings without erroring.

IIRC only Instance references (You can’t pass Instances created on the Client to the Server because the reference to it is nil on the server), objects like Vector3s, Color3s, and CFrames; and primitive datatypes like numbers, tables, booleans, and strings can be sent through a RemoteFunction or RemoteEvent because they can be serialized. This excludes things like function’s metatable’s and userdatas.

2 Likes