Everything I have read pcall should be used with Datastore because Datastore tends to error, I just started creating my script, but not exactly sure how to incorporate pcall into my script. I haven't started the saving portion of the script because I am going to be adding and saving many variables.
local DataStore = game:GetService("DataStoreService")
local dataPoints = DataStore:GetDataStore("testPoints")
game.Players.PlayerAdded:connect(function(plr)
local points = Instance.new("IntValue",plr)
points.Name = "Points"
points.Value = dataPoints:GetAsync(plr.userId) or 0
end)

3 comments
What is the "or 0" for?
If the GetAsync returns nothing, it sets the value to 0
If I helped you would you accept my answer?