Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Fix? - Cannot store Instance in data store. Data stores can only accept valid UTF-8 characters

Asked by 3 years ago

Script

for i,v in pairs(game.Workspace.Teleports:GetChildren()) do
    local dss = game:GetService("DataStoreService")
    local sv = dss:GetDataStore("Save1")

        game.Players.PlayerAdded:Connect(function(plr)
            local SetSuccess, errormessage = pcall(function()
            local PortalData = sv:SetAsync(plr.UserId,v)
        end)
        if not SetSuccess then
            warn(errormessage)

            local GetSuccess, amount = pcall(function()
                return sv:GetAsync(plr.UserId)
            end)
            if GetSuccess then
                print(amount)
            end
        end
    end)
end

Answer this question