Best way to keep reference to object between scripts [OOP]

Hello!
I would like to know if there is any common practice when sharing a created object between multiple scripts.

Realistically I understand that the best way would be to just structure your code in a way so that this doesn’t become an issue, but in my case it’s better to have a shared cache of it.

I have an object that is essentially an extension of the player and contains values about that player. I would like to have a method that is module.get(UserID) which either does module.new() or retrieves the playerObject from the modules cache.

Is this an acceptable method or should I rethink?
I’m also looking into the possibility of generating UUIDS and add to the cache if I wanna do this for other objects I have.

You pretty much have it figured out. You just have to make sure that the module that contains the cache doesn’t require any module that depends on this cache because that will cause a cyclic dependency. If this becomes a problem then you can isolate the cache in its own module whose sole purpose is to provide access to the cache.