Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What will cause a pcall of getasync to fail?

game.Players.PlayerAdded:Connect(function(plr)
local S,E = pcall(function()
    local GotAsync = DataStore:GetAsync(plr.UserId)
end)

if S then

if E then -- what will cause this to fire?

2 comments

0

if there is no plr data or the game has a problem with getting data from roblox

0

Data store requests are web requests, and you can't guarantee that all web requests will be always successful.

1 answer

The pcall function is there because it is not guaranteed that the player has data already saved. If the DataStore can't find the data saved, it will return an error.

1 comment

0

This is simply not true.

This discussion is preserved as it was. New answers, comments, and votes are closed.