How can I change table value 2 with a function? When I print the difference it works, but when I print it after it's still 0.
-----global value------
tabledifference= {0,0,0}
function differences(new,current,difference)
difference = new-current
print(difference)
end
print(tabledifference[2])
differences(tableonenew[2], tablecurrent[2], tabledifference[2])
--lets say tabeonenew[2] is 5, and tablecurrent[2] is 50

2 comments
Well, you're passing the value of 'tabledifference[2]' not the table itself.
But isnt it supposed to update that value? How would pass the table through it?