Asking About DataStore

local DataStoreService = game:GetService("DataStoreService")
local experienceStore = DataStoreService:GetDataStore("PlayerExperience")
local success, err = pcall(function()
  experienceStore:SetAsync("Player_1234", 50) ----- what is 50 means ? 
end)
if success then
  print("Success!")

what is 50 means and what is bennefits using, “Player_1234” ?

So what this script is doing is storing 50 XP in the player with the ID of “Player_1234.” If you use do that and then do:

local xp = experienceStore:GetAsync('Player_1234')

then the variable xp will be set to 50 because you set it to 50 originally.

1 Like

ahh, i see, thanks for helping

Yeah, no problem! There is an API Reference on the Roblox Developer Hub. Reading this will help: Introduction to Saving Data

1 Like