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

LoadNumber

The LoadNumber function was once used by an ancient data persistence method to return a number value that was previously saved to the player with Player/SaveNumber with the same key. Returns 0 if the key doesn’t exist, not nil.

Parameters

Name Type Default Description

key

Returns

Return Type Summary

Code Samples


Player:LoadNumber

The below would print the value of the player’s TotalPlays.

game.Players.PlayerAdded:Connect(function(Player)
    if Player:WaitForDataReady() then
        print(Player:LoadNumber("TotalPlays"))
    end
end)