I’m trying to decide what would be the best way (performance and convenience wise) to store enemies static data.
the general data i want to store is:
-
Exp: number
The exp the enemy gives after defeating it -
Gold: number
The Gold the enemy gives after defeating it -
Drops: Dictionary
The drops that could be dropped by the enemy and it’s chance to be dropped, for more understanding about how it looks, look at ModuleScript’s content
I thought about two ways to go about it.
Module Script

Info ModuleScript’s content:
local Rewards = {
["Gold"] = 10,
["Exp"] = 60,
["Drop"] = {
["Armors"] = {"ArmorName": 10, "ArmorName2": 20}
["Items"] = {"ItemName": 30 --[[The number is chance of getting it in percent]]}
}
}
return Rewards
I thought about making a module script called info, and every time I would want to access it i would do require([EnemyFolder].Info) or require([EnemyFolder]:FindFirstChildWhichIsA("ModuleScirpt")), that way i’ll get all enemy’s data.
Values

that way I’ll just go over the values and use Exp.Value to get it’s value. the pros here is that I don’t have to specify what kind of item it is in the drops, I just set it’s value to the drop in ServerStorage
the only issue with those ways is that i’m not sure how efficient each of those would be.
calling require all the time i want to get enemies data i think would be inefficient performence wise, and storing so much values sounds inefficient memory wise.
Note: also i sometimes would want to add static data type to give once the enemy is defeted like Points, EventCoins ect…