Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this causing an error?

Asked by 9 years ago

This is my script:

game.Players.PlayerRemoving:connect(function(player)

    local key = "user-"..player.userId

    local bp = player:WaitForChild("Backpack")
    local saveDataValues = {player.leaderstats.Points.Value,player.leaderstats.Gems.Value, player.leaderstats.Wins.Value, player.Stats.Losses.Value, player.Stats.TimePlayed.Value, player.Stats.Gems.Value}

    DataStore:SetAsync(key, saveDataValues)

end)

This is the error: Gems is not a valid member of IntValue (error is in line 6)

It is saying that Gems is not a valid member of something but I tested it before leaving the game and there was a Gems instance. Gems is inside a Folder (the error is saying that it is not a valid member of some IntValue)

Answer this question