Originally Posted by ChaosInc
Oh duh, it's a logic issue. Ok,here's the lowdown on what's happening in your example (still tired, bear with me ).
1) check for global foo
2) if global foo doesn't exist, create a local foo
3) after declaring the end of the if statement, local foo is destroyed. Translated as per the compiler:
4) attempt to create text
5) ERROR - a global foo still hasn't been created. And since the local was destroyed in stage 3, foo still remains as NIL
Also, I realize after looking back that the function would have to go before the scripts (which is always a good practice to maintain, for the record), but you posted the fix already.
|
How do I check for a local foo instead? And be defined in the function scope instead of the if statement? If this is impossible then defining them inside the update definitely isn't an alternative and I need a way around the 60 upvalue limit like I asked for in the first post.