CoreMain
|
  |
| Joined: 18 Jul 2014 |
| Total Posts: 78 |
|
|
| 15 Jan 2015 07:17 PM |
If let say I have a module and a script
[Module]
function f(b) local a = 0 a = b + a return a end
return f
[Script] local f = require(workspace.f)
local f1 = f(13) local f2 = f(666)
Both f1 and f2 will be consider different "classes" as in they won't be the same variable, right? |
|
|
| Report Abuse |
|
|
|
| 15 Jan 2015 07:22 PM |
Of course they won't be the same variable.
But since it isn't a table or function, you can just do it like this.
local f1 = 31 local f2 = f1 f1 = -2
And f1 and f2 are different variables.
It doesn't work that way with tables or functions though.
But since it is a local variable in your f function, of course it is no problem. But it wouldn't be a problem anyways. |
|
|
| Report Abuse |
|
|
CoreMain
|
  |
| Joined: 18 Jul 2014 |
| Total Posts: 78 |
|
|
| 15 Jan 2015 07:23 PM |
| Okay, thanks. I was just making sure... didn't want buggy modules. |
|
|
| Report Abuse |
|
|