I want to add savings slots to my game, but I don't know how I know that I need to use DataStore but... Is there any way to have saving slots
✓ ANSWER ACCEPTED
How to create saving slots?
1 answer
✓ Accepted answer
Brief explanation.
You could prefix the data store keys with 'slot1_' followed by the user ID of the player.
Don't understand DataStores?
To create saving slots in a Roblox DataStore, you can use the SetAsync method of the DataStoreService class. Here's an example of how you might use it:
local DataStoreService = game:GetService("DataStoreService")
local myDataStore = DataStoreService:GetDataStore("MyDataStore")
local function saveData(player, data)
local playerKey = tostring(player.UserId)
myDataStore:SetAsync(playerKey, data)
end
local function loadData(player)
local playerKey = tostring(player.UserId)
local success, data = pcall(myDataStore.GetAsync, myDataStore, playerKey)
if success then
return data
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
Oh ok thanks!
Glad I could help. Could you please mark this as an answer to help others who may have the same question?
How do you do the big letters?
umm you didn't use "local success, data" correctly
it should be "local success, data = pcall(myDataStore.GetAsync, myDataStore, playerKey)"