Help making a better stat formula

return x * (1+(n/100)) + n

This is my current formula I have right now. But I used it for player’s defense stat, and their HP was 102 when their defense stat was 1. The base HP in my game is 100 HP

Same goes for weapons. The base damage would be 5 damage, then if the player’s melee stat was 1, it would be like 5.5

I need a better stat formula.

1 Like

If you want it to be linear, you can just do return x * (1 + y*z).
x being the default value,
y being the amount it increases/decreases by each time,
z being the level its at.
Example:

local x = 1
local y = 0.5
local z = 4

print(x * (1 + y*z)) 
-- prints 3 because we add 0.5 for each level(4 levels total)

If you want it to decrease from the start value, just change the plus to a minus in your or my formula.

local x = 1
local y = 0.02
local z = 1

print(x * (1 - y*z)) 
-- prints 0.98 because we minus 0.02 per level(1 level)