I was wondering what was the best way to store classes?
The reason I would need this is for when I want to access a class outside the script that it was constructed from.
I was working on a commission for an Anime game a while back and they stored their classes by using _G, and I like to store my classes by creating a “Created Classes” list that stores all the classes that have been created which ca then be accessed by other scripts.
Is it even good practice to store class data? Please let me know!
When I create a class in a script then I can only access the class in the script I created it in.
By storing classes I mean like making it accessible to any server script.
You should use a module script for this that stores all the classes, it can be required by the scripts that need it. I don’t suggest using _G, because you don’t know when another script will ever edit it, even by mistake, so it’s hard to debug and pretty frustrating.