I currently store important data in two folders inside every Player object with NumberValues, one for persistent stats, (level, max stamina etc), and the other for temporary ones, (current stamina, speed multiplier etc), but I was wondering if this folder logic could apply to NPCs too, even though I haven’t added them yet
Even though in theory they WOULD init and load differently, is it inevitable to separate stat logic or could you find a common ground with also using Value objects to manage them with the same functions?
NPC’s and Players are the same thing, they’re just controlled by different things. And you’re likely already doing this if you’re using Humanoids as Humanoids are basically a single manager for Players and NPC’s. You should just be able to copy and paste the stats loader you have for the player and make it work with NPC’s. Hell you could probably use the same function loader you have for the player and make it work with NPC’s and just add an if statement to check if it’s a player or not and do this. This is what I’m doing though it’s not using folders or stat values but instead is just pure code.