Answer the question
In order to leave comments, you need to log in
How to add two numbers in Lua in Coregames?
The simple addition operation does not work.
I write the code correctly:
print=UI.PrintToScreen
b=1;
c=1;
a = b + c ;
print (a)
print=UI.PrintToScreen
print (1+2)
Answer the question
In order to leave comments, you need to log in
Not personally familiar with the coregames program (although thanks for clarifying).
However, offhand, I can assume that the UI.PrintToScreen function accepts only one line and does not accept any numbers. Therefore, you need to convert the number to a string:
print=UI.PrintToScreen
b=1;
c=1;
a = b + c ;
print (tostring(a))
print("The result = " .. a)
crash and all...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question