I wrapped in a pcall function and get a print statement that says "Error". The code is the same on the roblox developer page. I dont know what to do
local DataStoreService = game:GetService("DataStoreService")
local PointsStore = DataStoreService:GetDataStore("PointsStore")
game.Players.PlayerAdded:Connect(function(player)
local success,err = pcall(function()
PointsStore:SetAsync(player.UserId.."-Points",50)
end)
if err then
print("Error")
end
wait(1)
print(PointsStore:GetAsync(player.UserId.."-Points"))
end)

3 comments
is this a server script
i tried in serverscriptservice and workspace none of them worked
can you print err