How to calculate a lot of values

Hello there,

So i want to make a game, but i need to calcuate a lot of things per player. (Every player has a lot of stats, like strength etc…, and i need to use that to put it in a formula that will calculate the amount of damige a hit will deal to a enemy.)

I was wondering how i could achieve this. (it could be anything, as long as it helps me)

I though about it for a while and searched the internet, but i found nothing what i want to achieve. I wanted to make this, by using tables for every player. But i failed.

Could someone help me?

Should i use events, to tell the script when to calculate something, and where should i store my data?

(quick edit, i will most likely react tommorow)

My recommendation is
Add All of the Values you want, then divide it by the amount of values you decided to add get the mean of all of the values.

For Example:
I have these values
102
800
488
200

You do 102 + 800 + 488 + 200 / 4, Which is 397.5
You can either round it or not, which is up to you ofc

I dont exacly get what you are trying to say. My problem is that i need to handle a lot of values. The formula’s are not what i am asking for, but thanks for the idea!

Is your problem that you cant fit them onto a leaderboard?

Your problem is very vague. Can you give a description?

Yes, but no. Instead of using leaderboards and a heck ton of intvalues, i want to make this with a table for every player, and that the information in the table changes, and when that happens it will calculate the damige

Well, you got tons of stats

And i want to connect eachothers stats (different players) together, to get the amount of damige it will deal to the target.
(So like the target has x defence and you deal x damige than you deal x damige)

Are you going to get Average Damage?

What do you mean with avarage damige?

if this is damage 100 + 200 + 300
average damage = 200

Yeah so then do what I said
get every player’s stats, then add all of the player’s stats and divide it by the players. Then Multiply it by the Defense (it should be under 1 or they will do more damage)

Oh, no. Its more like you deal 100 dm and the other user has 10 dev than you deal 90 dm instead of 100

How do you get // caculate the damage?

Its just a value in a table (thats not where i am stuck)

So then top damage minus least damage is what your telling me
(anticipation)

Yeah but i want to get the stats, but how should i do that? ( Basicly thats the question) and do this 10x over to calculate the damige (use 10 different stats, like how tired you are and things like that)

Like should i use events, to tell the script when to calculate something, and where should i store my data?

Its pretty simple.

local stats = {
    ["Synitx"] = {Damage = 100},
    ["ROBLOX"] = {Damage = 10}
}

local roblox = game.Players.ROBLOX
local formula = (stats.Synitx.Damage - stats.ROBLOX.Damage)
roblox.Character.Humanoid:TakeDamage(formula)

Yeah this is kinda what i want but when can i see if the damige changes? Also thx. ( Like you equip new sword)

Your stats is in table I suppose?
I prefer you to make damage a number value for every player in leaderstats.
You can use

NumberValue:GetPropertyChangedSignal("Value"):Connect(function()
      print('number value changed')
end)