lua - How can i update a variable everytime i call it? -
for example, have variable math, don't want rewrite equation time, call variable math again.
how make math again every time call it? because though x,y , z change values throughout script, math returning same value.
or if there's way of doing need.
math = (x+y-z) print(math) -- same value -- lines later print(math) -- same value again
try this:
math = function () return (x+y-z) end print(math())
Comments
Post a Comment