# Is it possible to retain a variable when using the "Restart Game" blueprint function?

**URL:** <https://forums.unrealengine.com/t/is-it-possible-to-retain-a-variable-when-using-the-restart-game-blueprint-function/341563>\
**Category:** Editor Scripting\
**Tags:** savegame, leaderboard, restart, unreal-engine, saving, question\
**Created:** [December 15, 2015, 10:49pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-retain-a-variable-when-using-the-restart-game-blueprint-function/341563 "2015-12-15T22:49:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThatJoeThom](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ThatJoeThom](https://forums.unrealengine.com/u/ThatJoeThom)\
**Post date:** [December 15, 2015, 10:49pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-retain-a-variable-when-using-the-restart-game-blueprint-function/341563/1 "2015-12-15T22:49:35Z")

</div>

I am trying to create a local leaderboard for my game which only needs to be saved during a single session i.e. it doesn’t have to be recalled if the game is closed and opened again.

The easiest way that I’ve found to restart the game when the player runs out of lives is to use the “Restart Game” node like this:

 ![70774-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/1/2/6128444a9a5a037e49f2c185266f1df15faec4ca.png)

However as far as I can tell, this method will not allow me to keep the current players score variable for the leaderboard.

Is there any way I can retain the score variable when using this method? If not what is the best way to go about creating a local leaderboard that only needs to be saved for a single session?

Many thanks in advance!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ecb5cc49](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ecb5cc49](https://forums.unrealengine.com/u/anonymous_user_ecb5cc49)\
**Post date:** [December 16, 2015, 12:48am UTC](https://forums.unrealengine.com/t/is-it-possible-to-retain-a-variable-when-using-the-restart-game-blueprint-function/341563/2 "2015-12-16T00:48:24Z")

</div>

I think you want something like this: [https://docs.unrealengine.com/latest/INT/Gameplay/SaveGame/Blueprints/index.html](https://docs.unrealengine.com/latest/INT/Gameplay/SaveGame/Blueprints/index.html)

---

<div class="post-metadata">

**Author:** ![ThatJoeThom](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ThatJoeThom](https://forums.unrealengine.com/u/ThatJoeThom)\
**Post date:** [December 16, 2015, 1:07am UTC](https://forums.unrealengine.com/t/is-it-possible-to-retain-a-variable-when-using-the-restart-game-blueprint-function/341563/3 "2015-12-16T01:07:29Z")

</div>

Thanks, will give this a go.
