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

SaveNumber

Once used by an ancient data persistence method to save a number value that can be loaded again at a later time using Player/LoadNumber.

Parameters

Name Type Default Description

key

Returns

Return Type Summary

Code Samples


Player:SaveNumber

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)