|
| 30 Jul 2016 11:16 AM |
I'm stuck on a workaround to this issue. :C Structure:
function one() --things end
function two() --things end
Function two calls function one, function one calls function two at a certain point. You see my dilemma. Function two technically doesn't exist yet for function one so it can't call it. It's such a simple thing but it's bogged me down. |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 30 Jul 2016 11:22 AM |
Tag these functions and put the variables in a table. Call the function from the tag in that table. I've never done the above, so I don't know if it's valid, but alternatively you could require the functions from a module script. |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2016 11:25 AM |
Could you write a bit of script to show me how to do that? (As far as I know I thought tables could only contain individual variables) |
|
|
| Report Abuse |
|
|
TwoCoding
|
  |
| Joined: 26 Jul 2012 |
| Total Posts: 423 |
|
|
| 30 Jul 2016 11:30 AM |
You Could Do
wait(10)
one()
wait(5)
two()
Just Trying To Help Out! ~ TwoCoding |
|
|
| Report Abuse |
|
|
| |
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 30 Jul 2016 11:38 AM |
Yeah I'm pretty sure function1 can call function2 IF you call function1 after function. Don't auote me but it sounds logical. |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 30 Jul 2016 11:39 AM |
Sorry on mobile keyboard :/ The last word should be function2*
and auote is quote* |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2016 11:57 AM |
| Yea, putting Function1 after Function2 would work, but due to other reasons that's not possible. |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2016 02:23 PM |
Bump
I've been working on this but the solution still eludes me. |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2016 02:33 PM |
local Function1, Function2 -- Declare both variables as nil to start.
Function1 = function() Function2() end
Function2 = function() Function1() end
I don't think that's even really necessary though. It may warn you that it isn't declared yet, but I think it should still work even if you don't do that step.
|
|
|
| Report Abuse |
|
|