Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how do i make a save function where the thing i need to save is whether a part is black or red?

hi, im trying to make a save function for my game, the thing that needs to be saved is if a block is black or red, please only answer this question if you are 100% sure on the answer as i dont really need to know the answer to this because there are only 50 things to collect

thanks from poopypigeon245

1 answer

✓ Accepted answer

You can use DataStores.

Steps:

  • Define the datastore with the GetDataStore function of DataStoreService

  • Save to the datastore using SetAsync ~ provide a key to retrieve the value, and the value to save.

  • Load from the datastore using GetAsync ~ provide the key that holds the desired value

--Define datastore
local ds = game:GetService("DataStoreService"):GetDataStore("Part")

--Save to datastore
ds:SetAsync("Color",workspace.Part.BrickColor)

--Load from datastore later using
ds:GetAsync("Color");

This discussion is preserved as it was. New answers, comments, and votes are closed.