Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with Custom Health System?

Asked by 4 years ago

So I'm working on custom made health system with each limb or part having few values like resistance, bleeding factor etc.

I've looked into the ways to store these values securely and efficiently and I stumbled upon ModuleScripts. After a bit of research and learning I now have deeper understanding of ModuleScripts as means of storing data but I'm wondering on conceptual level how will it all function.

As I'm guessing I will have to create a table in ModuleScript that will be required by a Script. Upon new players entering I will have to add their data to this table and when they leave I will have to remove it. Whenever they get damaged or healed I will have to fetch this data from the ModuleScript in order to change it (using function inside ModuleScript of course).

I already have my code planned out but I have few questions regarding efficiency of this method as well as how it will function with let's say 50 players at once.

If this method is inefficient or the concept I described has better alternatives, I will gladly take any advises and corrections.

0
ModuleScripts are used to seperate your main code into smaller parts so that you can keep them organized. ScuffedAI 435 — 4y
0
You can use ModuleScripts to store any kind of data and they are believed to be more secure than using IntValues or _G. Tables itz_theDarkWizard7 0 — 4y
0
ModuleScripts are not some kind magical script that stores values securely or efficiently. ScuffedAI 435 — 4y
0
ModuleScripts can be used for many things and apparently storing values is one of them itz_theDarkWizard7 0 — 4y
0
One of many topics about ModuleScripts used for storing data https://devforum.roblox.com/t/using-actual-objects-vs-module-scripts-to-store-data/234309/4 itz_theDarkWizard7 0 — 4y

Answer this question