A better way to send an event from server-server

Obviously Remote Events etc can’t be used to send events between either client-client or server-server.

Recently I’ve wanted to send a message from one script to another on the server. I ended up accomplishing this by adding StringValues to a folder and listening for the ChildAdded event from the other script, and consequently reading the value.

Is there a better way to achieve this? For some reason I’m sceptical of this method and feel like it will go wrong :stuck_out_tongue:

Thanks

8 Likes

You can use a BindableEvent for this.
https://developer.roblox.com/api-reference/class/BindableEvent

19 Likes

Thank you.

I find that using Bindables are slow due to how they are serialized. Modules should be your first choice as they will only run once allowing you to share functionality between scripts.

This may also help you if you do not want to use bindables.

Hope this helps.

6 Likes

Probably not the type of answer you’re looking for, but I’d really recommend @Crazyman32’s AeroGameFramework

It’s completely solved the problem of recursive dependencies in modules, as well as communication in general. I’m using it on my next project, it really makes development a breeze(in my personal experience)

4 Likes