Namespace: Steamworks

Lua
C++
Edit

GetStat

This function gets a statistic for the user for this game.

Syntax

Returns

Returns the statistic value, or -1 if the value cannot be retrieved.

Example

-- Initialize Steamworks
if not Steamworks.Initialize() then
    RuntimeError("Steamworks failed to initialize.")
    return 1
end

-- Increment the stat
Steamworks.AddStat("NumWins")

-- Retrieve the current value
local value = Steamworks.GetStat("NumWins")
Print(value)

-- Shutdown Steamworks
Steamworks.Shutdown()
Copyright © 2006-2025 Ultra Software.
All rights reserved.
Leadwerks 4 Documentation