PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

Player:SaveNumber

Player:SaveNumber

Oct 01 2018, 2:04 AM PST

The below example would save a number to the player with a key of “TotalPlays” and add one to the value each time.

game.Players.PlayerAdded:Connect(function(Player)
    if Player:WaitForDataReady() then
        local OldValue = Player:SaveNumber("TotalPlays")
        Player:SaveNumber("TotalPlays", OldValue+1) 
    end
end)