BindableFunctions automatically delete non-integer keys in mixed tables. ex, if you attempt to Invoke({1, 2, var=3}) and then print arg.var, it will be nil. (For this reason I never use BindableFunctions.)
Global functions do not have this limitation, but I recommend using ModuleScripts instead, for organization (they also do not have the limitation). If (over time) you end up with two functions with the same name, if you have them in two different ModuleScripts you won't have any trouble, but if you try to put them both in _G then one will of course overwrite the other. In other words, using ModuleScripts means you don't need to worry about name collisions with other scripts.
[Edit]
ModuleScripts do cache the results of the script, but not the results of any functions within it. Here are some examples of what you can do with ModuleScripts:
return {}
local list = require(game.ServerScriptService.ModuleScript)
table.insert(list, "hi")
wait(0.1)
local list = require(game.ServerScriptService.ModuleScript)
print(list[1])
local list = {}
local sum = 0
local module = {}
function module.AddItem(item)
table.insert(list, item)
sum = sum + item
end
function module.GetSum()
return sum
end
return module
local module = require(game.ServerScriptService.ModuleScript)
module.AddItem(3)
module.AddItem(5)
local module = require(game.ServerScriptService.ModuleScript)
wait(0.1)
print(module.GetSum())
module.AddItem(10)
print(module.GetSum())
2 comments
I'm really not sure what the use of ModuleScripts are for either. They cache the results, so I wouldn't be able to run a modulescript and get different results based on a variable I pass it. It always returns the results from the first time it was ran.
Edited in response to your comment.