The most idiotic bug i've seen yet. Datastores work on my other games but not a certain one

Reset your data

game:GetService("DataStoreService"):GetDataStore("LeaderStatSave"):RemoveAsync(your user id)

and then replace function when player leaves with this:

plr.AncestryChanged:Connect(function()
		if plr:IsDescendantOf(game) or typeof(temporalData[plr.UserId]) ~= "table" then
			return
		end

should then save correct data

1 Like

replace it with this

if typeof(temporalData[plr.UserId].Abilities) ~= "table" then
    temporalData[plr.UserId].Abilities = {}
end
1 Like

I don’t understand by “Replace”

That could be one way to solve that, but the code ran past that and just left it at nil even tho he checked if it equals nil

Copy the lines of code I sent over your code

Works! Hopefully it doesn’t break.

In case it happens again, just do this:

local data = ds:GetAsync(plr.UserId)
temporalData[plr.UserId] = typeof(data) ~= "table" and {} or data

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.