What is g1 supposed to be. tointeger will only convert text digits. If there’s a decimal point or alpha characters, it returns nil. It also returns nil if there too many digits.
PS. I’ve never used Air Code so I can’t comment why it works there.
hmm I just ran that code with my g1, and it worked. I think my issue is that the line in my other code is not inside of any function block. Do you know how I could fix this? I would like to reference it from another function later.
Don’t make goal1 local. If a variable is local it can only be accessed from the function it’s in. If it not local (global) it can be accessed anywhere.
got it thanks! everything works now. Yea the global solution was pretty obvious… I kept putting global in front of my variables (whoops)… Thanks so much for the help!