|
| 22 Nov 2012 06:15 PM |
_G.Add = function (X, Y) return function (Add1, Add2) return tonumber(Add1[X]) + tonumber(Add2[Y]) end end
Now what might the bug be?
19:11:38 - Workspace.Script2:3: attempt to index local 'Add1' (a number value) 19:11:38 - Script "Workspace.Script2", Line 3 - global Ad 19:11:38 - Script "Workspace.Script", Line 3 19:11:38 - stack end |
|
|
| Report Abuse |
|
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 22 Nov 2012 06:16 PM |
| The problem is most likely how you're calling the function, not the function itself. |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 06:18 PM |
Ad = _G.Add()
print(Ad(1,1)) |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 06:18 PM |
| It was working and then it randomly stopped. |
|
|
| Report Abuse |
|
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 22 Nov 2012 06:19 PM |
Two problems:
You didn't pass X and Y to Add and '1' is not a table. |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 06:27 PM |
| I know, I just found out what the problem was. Thank you. |
|
|
| Report Abuse |
|
|