Stuck at this right now.
I’ll make an example in order to show my problem.
FILE 1: main.lua
–if button is pressed
x=x+1
return x
end
function.myFunc(x)
There’s a button that when pressed changes the value of variable ‘X’.
If button is pressed, x = x+1
Then this variable is passed as a parameter in function myFunc(x)
myFunc() is written in another file, e.g. functions.lua
FILE 2: functions.lua
myFunc = function(x)
print(x)
end
I believe that as myFunc is called only once, ‘X’ value is not being updated.
Can anyone help me please?
[import]uid: 98755 topic_id: 17596 reply_id: 317596[/import]