I'm using a datastore to save a table, however SetAsync() and any code that comes after it just doesn't run
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 HeadStats = { 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 } print("a") local HeadSave = game:GetService("HttpService"):JSONEncode(HeadStats) print(HeadSave) Heads:SetAsync(plr.UserId, HeadSave) end)
Code in question being:
Heads:SetAsync(plr.UserId, HeadSave) print("a")
The output contains:
a {"Ice":false,"Flumpy":false,"Lava":false,"Snow":false,"USA":false,"Germany":false,"Meqolo":false,"UK":false}
Marked as Duplicate by User#5423 and MrNicNac
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?