Originally Posted by Azul
What is wrong with this? It says that bar is global, and that it's nil.. when obviously it should be local, and not nil..
Code:
local frame=CreateFrame("Frame")
frame:SetScript("OnUpdate",function(self)
if not foo then
local foo=1
local bar="blah"
local pi=3.14
local text=""
end
text=foo..bar..pi
end)
I'm really starting to hate lua. I wish there was something else I could make addons in.
|
Since bar is declared locally in your IF statement, it won't be carried outside the block. Try putting it inside and see if it works.