Namespace: Steamworks

Lua
C++
Edit

SetStat

This function sets a user statitics value for this game.

Syntax

Parameter Description
key name of user statistic to set
value value to set

Returns

Returns true if the user statistic is successfully stored, otherwise false is returned.

Example

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

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

-- Set a new value
Steamworks.SetStat("NumWins", 105)

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