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

How would a save a database of storage for a player?

Asked by 6 years ago

I know how to save stuff like currency, but how would I save stuff like what items somebody has? Not items in an inventory, but for example, lets say I made jailbreak. How would I save stuff like what cars somebody owns? Or lets say I made MeepCity, how would I save what pets and clothing their wearing? I've tried to look online for stuff like this, but I cant find anything. If you could explain, direct me to an article, video, or anything please do.

0
you can use DataStore, but it cant save instances. you could try making values for your clothing or cars if its equipped or bought already User#23365 30 — 6y
0
Just have something like an intvalue in each item possible to own. Then when they leave save a table of all the values that are in the items they own. When they join the game again loop through the table in the datastore and find all the items in game that have values that match those in the datastore User#21908 42 — 6y
0
and give the player those items that matched User#21908 42 — 6y
0
This saves tables, if you insert anything, it saves: https://www.youtube.com/watch?v=bkEwlwM6HA4&t=104s greatneil80 2647 — 6y

1 answer

Log in to vote
0
Answered by
markjac -11
6 years ago

I'm not an expert on this subject but the simple approach I would take would be, saving values for each item. So if you buy a red car each player has a boolvalue or a numbervalue in them for the red car. So if you if you buy it the value becomes true or 1. Then save those values. Once someone leaves and rejoins make it so the player can equip/spawn the car if the value is true or 1. Could do this by making a button in a gui appear to spawn it in.

Ad

Answer this question