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

How do you use datastore for parts.?

Asked by 9 years ago

Please give me an example like if you where to customize a car and u want to save it for when you rejoin.

2 answers

Log in to vote
0
Answered by 9 years ago

-- Define Datastore

local PlayerCars = {}

Datastore = 

game["Players"].PlayerRemoving:connect(function(Player)
    Datastore:SetAsync(Player.userId,unpack(PlayerCars))
end)
0
Thanks for the example...i learned off this. ChrisCoder 0 — 9y
Ad
Log in to vote
2
Answered by
3dsonicdx 163
9 years ago

I'd say go to data persistence if you want the easier method for that.

http://wiki.roblox.com/index.php?title=Data_store

*Unlike Data Persistance, Data Stores cannot save ROBLOX instances directly. For example, calling DataStore:SetAsync("key", Instance.new("Part")) will throw an error. You should write a function that converts the instance to a table or string. *

So for what you would do for datastores, is make each part of the car converted into a string(So you'll have to make a script that reads that string and creates the brick for X car).

0
Can you give me an example. ChrisCoder 0 — 9y
0
Chris, this is not a request site. fahmisack123 385 — 9y

Answer this question