# Steam Leaderboards - SetIntStat is incrementing instead of replacing

**URL:** <https://forums.unrealengine.com/t/steam-leaderboards-setintstat-is-incrementing-instead-of-replacing/372384>\
**Category:** Platform & Builds\
**Tags:** onlinesubsystem, steamworks, leaderboard, unreal-engine, CPP, question\
**Created:** [October 4, 2016, 1:39am UTC](https://forums.unrealengine.com/t/steam-leaderboards-setintstat-is-incrementing-instead-of-replacing/372384 "2016-10-04T01:39:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oraclefish](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Oraclefish](https://forums.unrealengine.com/u/Oraclefish)\
**Post date:** [October 4, 2016, 1:39am UTC](https://forums.unrealengine.com/t/steam-leaderboards-setintstat-is-incrementing-instead-of-replacing/372384/1 "2016-10-04T01:39:52Z")

</div>

Hey Everyone

I’ve finally gotten my code to write to my steam leaderboards! The answer was to create a stat in addition to the leaderboard in Steamworks (named “StatName\_StatName” StatName = the stat name called in SetIntStat), and write to that.

However, now my code is incrementing the stat instead of replacing it - even using the SetIntStat function instead of IncrementIntStat.

Here’s my code:

 ![109592-setintstat_incrementing.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/b/5/5b5fec49accc4c74b63e4f44257ea12f4d5471f5.png)

Does anyone have any ideas as to how to get Steam to just overwrite the stat instead of increment it?

My other option is to read the leaderboards, find the player ID, grab their previous high score and subtract the old one from the new one before uploading **(example: Score - OldScore)**, but that’s messy…With that method, I’m also struggling to figure out how to make the code wait for it to finish reading before it continues…

---

<div class="post-metadata">

**Author:** ![Isaac\_S](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Isaac\_S](https://forums.unrealengine.com/u/Isaac_S)\
**Post date:** [December 7, 2017, 9:10pm UTC](https://forums.unrealengine.com/t/steam-leaderboards-setintstat-is-incrementing-instead-of-replacing/372384/2 "2017-12-07T21:10:48Z")

</div>

Have you figured this out? I can see how that’d work if the new score was higher but what if it was lower? Is there a way to completely replace the score as originally intended?

It won’t let me update it with a negative integer.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_21e718d4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_21e718d4](https://forums.unrealengine.com/u/anonymous_user_21e718d4)\
**Post date:** [February 20, 2018, 3:41pm UTC](https://forums.unrealengine.com/t/steam-leaderboards-setintstat-is-incrementing-instead-of-replacing/372384/3 "2018-02-20T15:41:26Z")

</div>

The **ScoreValue** variable should be negative if you want to decrement the leaderboard score, I didn’t found the way of overwriting it. I also has made this assignment like you did:

> `UpdateMethod = ELeaderboardUpdateMethod::Force;`
