DS Table wiping after every save

Hi!

I’m making a temporary plot display thing.
(please starters, dont code this way. it’s awful and just until i can do something else)

The issue is it’s resetting the table.
Screenshots:


Loading code:

	local Data = {}
	Data = UserDS:GetAsync("Data") or {}
	table.insert(Data, {
		Player.UserId,
		PlotID,
		PlotName
	})
	local succ, err = pcall(function()
		DS:SetAsync("Data", Data)
	end)
	if not succ then warn(err) return else print("Worked..?") print(Data) return end

Thanks for any help!

Probably not it, but you’re using SetAsync on DS but GetAsync on UserDS… without context I’m assuming they’re different datastores.

1 Like