Module Scripts vs, Bindable Functions

Remote Functions and Module scripts are different as remote allows for server to client communication.
Module scripts allow for functions that multiple scripts can access usually only on server or only on client.

But what’s the difference between module scripts and just creating a script with a bindable function/event inside? Would they function the same or different?

1 Like

BindableEvents in simplest terms are user-made events, some-what similar to the Roblox event system.

I can’t really give a use case for it, but for event-based programming it’s the ideal approach.

local myEvent = Instance.new("BindableEvent", workspace)

function onEvent(...)
print(...)
end

myEvent.Event:Connect(onEvent)

myEvent:Fire(1, 2, 3)

As far as BindableFunctions go, they seem to serve an identical purpose to ModuleScripts. From my knowledge, they can be used interchangeably. It might make more sense to use BindableFunctions for when you have specific tasks you need to do, rather than creating a whole new ModuleScript for a simple task (and not a whole system) you might need to achieve from multiple scripts.

5 Likes

They do the same thing, but networking wise they’re different. You could probably run benchmarks but I’d say the safer bet would just be using module scripts as they’re way more versatile.

1 Like

The only notable thing between the two is their Script Identities. But this wouldn’t be very important for most use cases because developers will mostly be working only with Script Identity 2 scripts. Bindeable Functions and Events would be running at a Script Identity of 2 while ModuleScripts will be running at the Script Identity of the same level as the script(s) the require it.

1 Like