Hello Developers,
So i was making this datastore but when the user left, it will save the datastore. But my problem is in this line, return AccountService:SetAsync(player.UserId..'-id:'..'-[-]',AccountService:GetAsync(player.UserId..'-id:'..'-[-]'))
. it says Unable to cast array. I’ve tried searching on the web [Unable to cast to array] but doesn’t match with my problem.
local function player_LEFT(player)
--[[ Output: table ]]print(typeof(AccountService:GetAsync(player.UserId..'-id:'..'-[-]')))
local success, err = pcall(function()
return AccountService:SetAsync(player.UserId..'-id:'..'-[-]',AccountService:GetAsync(player.UserId..'-id:'..'-[-]'))
end)
--[[ Output: Unable to cast array ]]print(err)
if success then
warn('Data saved successfully for '..player.Name)
else
warn('Data saved unsuccessfully for '..player.Name.." we're really sorry :(")
end
end
Thank you so much for helping me, i really appreciate it!