How would I go about making a unique stats system?

Hey there! I am making an ATLA game, and I was inspired by Derelict’s stats system. I want to make some stats similar to it, but I do not know how to do it. Do I have to make a seperate framework for each? Here is a picture (each one has a level bar):

Screenshot 2023-11-21 180426

And no, I’m not asking you to write the script(s) for me, I’m just asking to be pointed in the right direction.

Sorry in advance if I’m misunderstanding anything, but

For each stat, have an XP count and a level count. When XP reaches full for each level:

if playerXP >= maxXP then

increment the level, and subtract the maximum XP from your current XP (accounts for any “extra” XP over the limit).

playerLevel += 1
currentXP -= maxXP

Tables could simplify that, so you could have

PlayerLevels = {
["Strength"] = 2,
["Fishing"] = 5,
["Scripting"] = 10
}

and reference them as PlayerLevels[string] instead of having a unique variable for each; same for XP counts.

Thank you! This was very helpful!

1 Like

Further info:
]
If you want the XP requirement for each level to be progressively higher, you could do something like

if playerXP["Fishing"] >= 100+(100*(0.1*playerLevel["Fishing"])) then etc to add 10 percent for each progressive level

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.