Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Is there a way to send tables w/ metatables through a BindableEvent?

Asked by 6 years ago

I've been building a sandbox for a project I'm working on, but I'm stuck on events. I can't think of any way of being able to transfer events through a event.

I'm using a modulescript which handles all the sandbox stuff, and I require it on the other end with a regular script.

Is it possible to transfer through my sandboxed tables to the other end or do I have to do some trickery on the other end to get it to work?

0
Try HTTP's Encode and Decode. superalp1111 662 — 6y
0
JSONEncode strips the table of it's metatables TheFlamingBlaster 5 — 6y

1 answer

Log in to vote
0
Answered by
Avigant 2374 Moderation Voter Community Moderator
6 years ago

You could serialize the metatable in theory, but in practice that's terribly inefficient and a very bad solution. Instead, I recommend implementing a module for events (they're about twice as fast as BindableEvents when replicating their functionality). The only downside is that you can't implement RBXScriptSignal:Wait() without an Instance.

0
arent functions not able to be serialized though LegitimatlyMe 519 — 6y
Ad

Answer this question