What is the best way to save weapons/tools with DataStores?

Hi Developers! :wave:

I was wondering how to save weapons in an optimized and fairly simple way? I mean these are Instances, and they’re too large to be efficiently saved I think. Would it be possible to make a table with names of every weapon player got and then somehow give them to player when he joins back?

I’d appreciate any help provided! :hidere:

Just save the names. This is a good reason to have the player-facing naming of things be separate from your internal names, so that you can change the player-facing ones without breaking anything. I have a vehicle building system that saves vehicles. It only saves the component name, what it was placed on, the relative position, and any per-component special info such as whether a hinge was locked or unlocked.

3 Likes

In your case special info could be ammo or list of available attachments. Each weapon should have a function that saves/loads its particular special info. This is good interface separation.

1 Like

Thank you a lot for advice! I hope I’ll figure out how to code all that stuff with my dumb brain…

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.