Trouble with table

Hello, im troubled with table.

[LUA]
local _table = {
“10”,
“20”
}

for k, v pairs(_table) do
–Here! How to plus 10 to every value?
–v = v* + 15
end
[/LUA]

Please any suggestion, i can’t solve this, maybe table.insert or what?



local _table = {
  "10",
  "20"
}
local ret = 0
for k, v pairs(_table) do
    ret = ret + v
end
print(ret)


Untested but should work.

You can’t add a number to a string. You have to change “10”,“20” to 10,20. And then:
[lua]
for k, v in pairs(_table) do
_table[k] = v + 10
end
[/lua]

nvm, didnt read well, it should be



local _table = {
  "10",
  "20"
}

for k, v pairs(_table) do
    table.insert(_table, k, v+10)
end


[editline]17th August 2015[/editline]

Ninja’d :v:

Thanks all!!