So I’m making an enemy, and I don’t want to save his stats(running speed, hitting power, etc) in his script. I would like to make a separate place where there will be all the characteristic about enemies, prices and everything else. But where do I do it? In ServerStorage? Replicated? Or in modular scripts? If there, please show me an example of how to save and retrieve data from there, thanks!
1 Like
What are you trying to do in this “separate place”?
In my development carreer I stumbled upon the exact same problem as you do right now, and the solution for me was the use of classes made with metatables. When you use this technique, you can store all the data from your enemy inside of a metatable, and make functions for your enemy as well. In fact, the full understanding of this subject is a little tricky, but once you get the feeling for it, this way of creating mobs and many more things is extremely powerful!
A good video tutorial that really helped me out when I tried to understand it:
1 Like