I have heard that local variables are faster than global variables and was wondering, does that mean local functions are faster than global functions?
Also, I have a ModuleScript for Client use so I have stored it in ReplicatedStorage. I am wondering, do you only use functions in ModuleScripts for both server-side and client-side or do you use local functions. If so when do you use local functions and global function?
The only difference between local and global functions are it’s scope. Technically local functions are faster than global ones (Sometimes ~10% faster).
ModuleScripts should be used if you have a specific function used in multiple scripts. You can also make an OOP system but that’s pretty advanced.
TL;DR: Use local functions if you only use that function in a single script, a ModuleScript otherwise.
When I say ~10% faster, I mean it performs 10% faster (or even faster) whenever a localized variable or function is used in a time-critical loop. An official article references this.
You can read why a local variable or function is faster on the article above.