When I save my data in game and use GetAsync it gets the data back just fine, but if i rejoin and use GetAsync the data is back to 0.
for _,v in pairs(game.Players:GetChildren())do
--saving god power
local success, err = pcall(function()
--print(v.PlayerInfo.Stats.Followers.Value)
return godPower:SetAsync(v.UserId, v.leaderstats:FindFirstChild("God Power").Value)
end)
if success then
print("godpower saved")
end
local success, err = pcall(function()--god power
currentGP = godPower:GetAsync(v.UserId) or 0
end)
print("SAVED: "..currentGP)
end
this prints "SAVED: 146"
Players.PlayerAdded:Connect(function(player)
local success, err = pcall(function()--god power
currentGP = godPower:GetAsync(player.UserId) or 0
end)
if success then
print("power:"..currentGP)
player.leaderstats:FindFirstChild("God Power").Value = currentGP
end
end)
this prints "power:0"

1 comment
Try to remove the get async in the first script. Maybe that helps.