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

Global functions or Modules?

Asked by 8 years ago

Hey there, so I have been wondering for a while now as to what I should use Global Functions or Module Scripts. I want to know as to which one is more efficient and by 'efficient' I mean one that causes less lag and more smoothness in the game.

Thank you for putting your time into reading this question and if you have any questions as to what I mean please post them in the comments below.

~~ KingLoneCat

1 answer

Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
8 years ago

Neither will cause any lag. Lag is caused by all of your resources being used up. Work uses resources. There's no work involved in something so minute.


You should avoid global functions and variables in as much as it is possible, they are difficult to make work the way you want.

Use ModuleScripts.

You can also use BindableFunctions as a more controllable alternative to global functions (though you can only pass JSONable data+instances through them)

Ad

Answer this question