How can I save these models?

Hello Devs! I am working on a game, which I don’t have too many details YET, but what I need is a feature to save my boats.

What I am trying to achieve, is that a user would buy a boat from the shop, and they would keep that boat, even if they leave the game, they still own it.

The boats are in a folder in Replicated Storage, and each boat has its own model.

I would appreciate some help, as i am on the “newer” side of scripting, and im clear lost for this.

Hope I provided enough details :slight_smile:

Hiwi!
Yup, is very clear. You need to use DataStore, its a table, you save the Model Type/Name of the Boat that a player bought on the players “account data”.
Then when the player wants his boat, idk maybe you want it to spawn it by using a button. That function will find the data name in the account and Clone() the Boat from ServerStorage, and place it wherever you like.

Check some links on how to use datastores:

Hope you find useful info :3

1 Like

Wow. That was quick. Thanks! Ill try this out and get back to you once i get it working. Ty for your time :slight_smile:

1 Like

Extra tip: this involves serialization. In this case, you can save the name of the boat in a string, and FindFirstChild() with the string while saving data and loading data.

Hope im not asking for too much, but what would be a script example of this?

Go to 21:56.

So, my boats are in a folder in rep storage. Instead of plr.Backpack, should i create a Instance.new and create a folder inside the player for their owned boats??

I suggest is better to use ServerStorage to store that type of stuff. ReplicatedStorage can be accessed by LocalScripts, that causes risks in your game, like exploiters can access there and get the boat free…

ServerStorage is safe, can only be accesed by Server Scripts, so, a client script ask for a boat previously bought, and a server script analize if that player actually bought it or not. Server decide and give the boat or not

1 Like

Thanks, i am going to move the folder with the Boat Models to serverstorage

1 Like