Okay. Just a disclaimer, I'm still trying to figure out LUA syntax again after leaving it for C++ and vb.net (those are both a lot of fun, highly encourage learning them.) But I really wanted to come back to LUA and see if I can't get where I am with LUA like I am with vb.net and C++.
Edit I really missed the mark with this snippet... I'm going to try to rebuild it from scratch, if you think you can help me, go ahead, but there are evidently a lot more problems than just starting the for loop on line 7.
stocks = {KNG = 250, OCT = 1500, SHL = 2000, SNY = 4350, DEL = 8750, MCR = 25000}
function newValue(stock)
stock = stock + math.random(-(2*stock), (2*stock))
end
for each in stocks do
newValue(each)
print(each)
end
print(stocks)
The error says Workspace.priceVal:7: attempt to call a table value

1 comment
I assumed you were trying to get the numbers from the table use them with the equation in your function and then print each of them. Which the above script does. If you want to know anything else just let me know...