• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Item Upgrade basic value[1.2]

Ascuas Funkeln

Rakkedo Game
Joined
Apr 14, 2013
Messages
549
Solutions
32
Reaction score
305
Location
Poland
GitHub
AscuasFunkeln
Hello, i need help with this script.
What i want is, make this % upgrading every time from basic value, not from actual value.
Example:
Armor Value: 100
Upgrade per hit: 3%
Result from 0% to 3% is 105 instead of 103, cuz they calcuate all 3 level, and take value of actual lvl instead of basic 100.

@Edit
Ok thread to close i make it.

In this function:
Lua:
local upgrading = {
  upValue = function (value, level, percent)
  if value < 0 then return 0 end
     if level == 0 then return value end
     local nVal = value
     for i = 1, level do
       nVal = nVal + (math.ceil((value/100*percent)))
     end
  return nVal > 0 and nVal or value
  end,
Change this line
nVal = nVal + (math.ceil((nVal/100*percent)))
to this
nVal = nVal + (math.ceil((value/100*percent)))

:)
 
Last edited:
Back
Top