I'm using ModuleScripts for the first time in... about a year? Anyway, I remember most of my experiences with them and so far it's going well. But I ran into a bit of a problem as you can see with this GIF. See the blue lines underneath the code? I looked at it and it says "Unknown Global 'TweenJointC1'"
But clearly, above that, you can see "module.TweenJointC1"
Do I just need to put in module.TweenJointC1
instead of just TweenJointC1
When you define the TweenJointC1
variable, it is an index in the module
table. It is not a direct member of the global environment; so, trying to reference it from the global environment is going to give you the error you received.
You need to access the value directly through the 'module' table.
module.Fire = function() module.TweenJointC1(weld3); end
But like always, you can use variables to shorten repetitive lines of code.
local tc1 = module.TweenJointC1; module.Fire = function() tc1(weld3); end