Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Datastore for a model?

Asked by
OBenjOne 190
4 years ago

Hello, I am making a game where players build a custom vehicle out of lots of different blocks and models. I have the building part completed, however I need to be able to save the model they make in between games. I have not used datasaves much, but I know that they are used for storing values such as level or cash of a player. The only time I used them, they were starting to overload after auto saving every minute, with less than ten numbers stored in them. I was just wondering if it would be feasible to save an entire vehicle:

car1 = workspace.Model:Clone()
--then put the car as one of the values in the table (possibly with 3 or more save files)
sessionData[playerUserId] = {car1,car2,car3}

I was simply wondering if this would be possible or if it would overload the save.

Thanks

0
You have to save how the car it put together e.g. the parts and positions ect. There is a character limit per key so you would be better off using keys just for the car save [player id]_car1, [player id]_car2 ... User#5423 17 — 4y
0
 I was afraid of that. OBenjOne 190 — 4y
0
*makes roblox character death sound* OBenjOne 190 — 4y

1 answer

Log in to vote
2
Answered by 4 years ago

you could use a serializer to serialize the model and then save the model to a datastore, but that'd quickly fill the key character limit.

other games, such as bloxburg have pulled this off by, what I think they do is if the string gets longer than 260,000 characters, they split the string, and then save the other that gets left in another key.

0
Thanks for the help, I will look into ways to serialize the model. OBenjOne 190 — 4y
0
I guess all I need to store is the exact same data the client had to send to create the model in the first place, so I won't have to save every property OBenjOne 190 — 4y
Ad

Answer this question