Why am I getting this Error?

Hi there,

Every time I load my game I keep getting a error that is saying this:
image
What Can I do to make this go way?

	local Players = game:GetService("Players")
	local DSS = game:GetService("DataStoreService")
local DS = DSS:GetDataStore("SaveData")



	Players.PlayerAdded:Connect(function(plr)


		wait(6)
		local plrkey = "id_"..plr.UserId
		local savevalue = plr.leaderstats.Pounds
		local savevalue2 = plr.leaderstats.Bounty 
		local savevalue3 = plr.leaderstats.Kms 

		local GetSaved = DS:GetAsync(plrkey)
		if GetSaved then
			savevalue.Value = GetSaved[1]
			savevalue2.Value = GetSaved[2]
			savevalue3.Value = GetSaved[3]

		else
			local NumbersForSaving = {savevalue.Value, savevalue2.Value, savevalue3.Value}
			DS:GetAsync(plrkey, NumbersForSaving)

		end
	end)



	Players.PlayerRemoving:Connect(function(plr)
		DS:SetAsync("id_"..plr.UserId, {plr.leaderstats.Pounds.Value, plr.leaderstats.Bounty.Value, plr.leaderstats.Kms.Value}) 

	end)

If you can help me out that Would be great~

1 Like

Do you have any other scripts (freemodels perhaps) that could be giving off this error?

Ctrl shift f for these and delete whatever script uses them or delete the part that uses it.
image

It’s maybe because your code is deprecated or your game used DataPersistance before. Try checking for old models if any and check the code of it. Basically DataPersistance was a very old version of DataStores.

1 Like

I know I replaced the datastore script

Do you have any other script that saves data?

I got a Dealership one and a Tools Save data

Does it use DataPersistance or any deprecated code ?

I can’t Find anything that I know of that uses it.

I checked more on this error rn but I found that it occurs only if the code uses it.

Can you tell me exactly on which line this error occurs ?

It doesn’t say what line it is nor the script

Oh, is your game too old though ?

Nah It Can’t be It’s only a year old

Oh, then try to update your game either. Also, I hope you have turned on API Services.

Yeah I do have API Services on.

Ok, try to update your game, like try “Save To Roblox” or “Publish to Roblox”. It’s the only way I can think of.

1 Like

Ok I found it. It Was The old Kohl’s Admin Commands

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