For some reason the last 2 lines of code inside the :PlayerRemoving() aren't running. I'm currently trying to use a table inside of the datastore, so I don't have to use single datastores.
game.Players.PlayerRemoving:Connect(function(plr) local money = game.Players[tostring(plr.Name)].leaderstats.Money.Value local Stats = game:GetService("ReplicatedStorage").Stats[plr.Name].HeadsCaptured local Heads = { Flumpy = Stats.Flumpy.Value, Germany = Stats.Germany.Value, Ice = Stats.Ice.Value, Lava = Stats.Lava.Value, Meqolo = Stats.Meqolo.Value, Snow = Stats.Snow.Value, UK = Stats.UK.Value, USA = Stats.USA.Value } Money:SetAsync(plr.UserId, money) print("a") Heads:SetAsync(plr.UserId, {Stats.Flumpy.Value,Stats.Germany.Value,Stats.Ice.Value,Stats.Lava.Value,Stats.Meqolo.Value,Stats.Snow.Value,Stats.UK.Value,Stats.USA.Value}) end)
Any help is appreciated