Originally Posted by Azul
Edit: fixed it by moving it over the OnUpdate.. and now it says it's trying to concatenate foo as a GLOBAL, and that it's NIL. Just like in my example.
|
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.