πŸ’ΎData Functions

A brief summary of all available DataStore related functions.

getData(player: Player): {any}

Returns the provided Player's leaderboard data.

Example

local success, data = pcall(function()
    return Ezstatz:getData(player)
end)
if success then
    if data then
        print(data)
    end
else
    warn("something went wrong.", data)
end

saveData(player: Player)

Saves all of the current values inside of the Player's leaderstats folder into the datastore.

Example

local success, message = pcall(function()
    Ezstatz:saveData(player)
end)

if not success then
    warn("something went wrong.", message)
end

eraseData(player: Player): {any}

Clears a Player's Datastore key if there's any data present within it.

Example

local success, recoverable = pcall(function()
    return Ezstatz:eraseData(player)
end)

if success then
    if recoverable then
        print(recoverable)
    end
else
    warn("something went wrong.", recoverable)    
end

Last updated