Hello, I had a problem that some item is created only in a certain folder at a certain time, and to prevent errors, I installed a check whether the table is empty, but even with an empty table, the function is executed, how to fix it?
game.Players.PlayerRemoving:Connect(function(player)
print(player.OtherBoost:GetChildren()) -- I get "{}"
if player.OtherBoost:GetChildren() ~= {} then --problem
local tableOfDataBoost = {
["HeavenBuff"] = os.time() + player.OtherBoost.HeavenBuff.Value
}
local success, errormessage = pcall(function()
print(tableOfDataBoost)
datastore:SetAsync(player.UserId, tableOfDataBoost)
end)
end -- end "if"
end)