There is no error.
local DSService = game:GetService('DataStoreService'):GetDataStore('Hamburger223232') game.Players.PlayerAdded:connect(function(plr) -- Define variables local uniquekey = 'id-'..plr.userId local leaderstats = Instance.new('IntValue', plr) local savevalue = Instance.new('IntValue') leaderstats.Name = 'leaderstats' savevalue.Parent = leaderstats savevalue.Name = 'Tokens' -- GetAsync local GetSaved = DSService:GetAsync(uniquekey) if GetSaved then savevalue.Value = GetSaved[1] else local NumbersForSaving = {savevalue.Value} DSService:SetAsync(uniquekey, NumbersForSaving) end end) game.Players.PlayerRemoving:connect(function(plr) local uniquekey = 'id-'..plr.userId local Savetable = {plr.leaderstats.Tokens.Value} local sword1 = plr.Backpack:FindFirstChild("Venomshank") local sword2 = plr.Backpack:FindFirstChild("Firebrand") local sword3 = plr.Backpack:FindFirstChild("Windforce") if sword1 then Savetable = Savetable+50 end if sword2 then Savetable = Savetable + 100 end if sword3 then Savetalbe = Savetable + 150 end DSService:SetAsync(uniquekey, Savetable) end)