I was mainly active on Roblox studio 2 years ago due to exams and I’ve noticed in the past couple weeks that modulescripts have become particularly prominent.
In the past I’ve mainly used BindableEvents for separate functions since I haven’t worked on any games large enough to require a library. It has come to my attention now that perhaps I should be using ModuleScripts for such a purpose but I’ve already invested too much brainpower to alter my existing scripts and I don’t see any performance issues as of now.
Could someone explain when to use BindableEvents/ModuleScripts/Global Functions?
1 Like
Bindable Events: BindableEvent | Documentation - Roblox Creator Hub
Module Scripts: ModuleScript | Documentation - Roblox Creator Hub
Global Functions: Global function?
heres some stuff i found about all of those things.
i think bindableEvents are like remoteEvents but from client to client/server to server (same script context to same script context)
module scripts are like modules in other programming langauges (example: python), it can be used to hold data/functions that can be used outside of the module in another script. (using modules is a better practice than using global funcs)
edit: i could be really wrong about bindableEvents, but i think thats how you use them, you may also want to take a look at unreliableRemoteEvent’s: Introducing UnreliableRemoteEvents
1 Like
Apologies if the question was unclear.
BindableEvents, ModuleScripts and Global Functions all allow the use of code from one script to be used in another. Are there specific scenarios where it’s better practice to use each?
1 Like
i think using modules is WAY better than global functions tbh (opinion)
^ this is because it would be way more organized.
i don’t use bindableEvents as much to be honest.
1 Like