whitevo
Feeling good, thats what I do.
Well im now at the point where i wanted to finish up my custom stat system.
Its nothing too fancy, but i wanted to make the script look fancy and small as possible.
So i had the idea how making functions, inside the functions.
But now the problem comes: how to pass the result into local table?
Here is what i tried, but it doesn't work so easily
Would be nice if someone knows how to make this function pass values to table without using function inside the table, then that would be aawzom.
Meanwhile i simply wont use the checkStats function.
Its nothing too fancy, but i wanted to make the script look fancy and small as possible.
So i had the idea how making functions, inside the functions.
But now the problem comes: how to pass the result into local table?
Here is what i tried, but it doesn't work so easily
Code:
local resistances = {
fireResistance = 0,
iceResistance = 0,
deathResistance = 0,
energyResistance = 0,
physicalResistance = 0
}
Code:
function checkStats(item, resistances)
local itemStat = item:getDescription()
local hasGem = gemCheck(itemStat)
if hasGem then
local resType = resCheck(hasGem)
for k, v in pairs(resistances) do
if k == resType then
v = getValue(hasGem)
end
end
end
return resistances
end
Would be nice if someone knows how to make this function pass values to table without using function inside the table, then that would be aawzom.
Meanwhile i simply wont use the checkStats function.