Eversince about a hour ago my stats have not been loading and i think its because of this. Im using this script. Please help me fix it.

-- Read the description of the model for details, it pretty much says to just put it in.


function onPlayerEntered(player)
wait()-- Change to wait for player longer.
player:WaitForDataReady()
repeat wait() until player:FindFirstChild("leaderstats")
if player.DataReady then
if player:findFirstChild("leaderstats") then
local score = player.leaderstats:GetChildren()
for i = 1,#score do
local ScoreLoaded = player:LoadNumber(score[i].Name)
wait()
if ScoreLoaded ~= 0 then
score[i].Value = ScoreLoaded
end
end
end
end
end

function onPlayerLeaving(player)
if player:findFirstChild("leaderstats") then
local score = player.leaderstats:GetChildren()
for i = 1,#score do
player:SaveNumber(score[i].Name,score[i].Value)
end
end
end

game.Players.PlayerAdded:connect(onPlayerEntered)
game.Players.PlayerRemoving:connect(onPlayerLeaving)

4 comments

0

Your question title is a Roblox Generated warning. It does not help us solve this question. Also, please provide more explanation with your script, such as what you changed about it and what the actual error it produces is.

0

I don't think HttpPost is anything to do with this script. My friends stats saved so i must have been curupted

0

It's a ROBLOX internal bug.

0

You are using Data Persistence which is deprecated, meaning it isn't support in current updates. Just a tip. It may work or not