local DSS = game:GetService("DataStoreService") local moneyDataStore = DSS:GetDataStore("ExampleDataStore", money) game.Players.PlayerAdded:connect(function(plr) scope = "User_"..plr.UserId local stats = Instance.new("Folder", plr) stats.Name = "leaderstats" stats.Value = moneyDataStore:GetAsync(scope) -- I would not normally do leaderboards this way this is just an example --how would I wrap this Get Async in a pcall
local DSS = game:GetService("DataStoreService") local moneyDataStore = DSS:GetDataStore("ExampleDataStore", money) game.Players.PlayerAdded:connect(function(plr) scope = "User_"..plr.UserId local stats = Instance.new("Folder", plr) stats.Name = "leaderstats" local success, message = pcall(function() stats.Value = moneyDataStore:GetAsync(scope) end) if success then -- code else print('Datastores have failed, error: '..message) end end)