So what I’m trying to do is set the data to 0 if the player does not have any data yet. If the player has data, it will set a value to it, but why is it giving an error? I am completely clueless
game.Players.PlayerAdded:Connect(function(p)
local l0=Instance.new("BoolValue")
local l1=Instance.new("BoolValue")
local l2=Instance.new("BoolValue")
local l3=Instance.new("BoolValue")
if not game:GetService("DataStoreService"):GetDataStore("l0"):GetAsync(p.UserId) then
game:GetService("DataStoreService"):GetDataStore("l0"):SetAsync(0)
print('falisified')
end
local success, err = pcall(function()
game:GetService("DataStoreService"):GetDataStore("l0"):GetAsync(p.UserId)
end)
if success then
print(success)
end
end)