# How to check for all of a map's variables

**URL:** <https://forums.unrealengine.com/t/how-to-check-for-all-of-a-maps-variables/1310147>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [September 24, 2023, 11:16am UTC](https://forums.unrealengine.com/t/how-to-check-for-all-of-a-maps-variables/1310147 "2023-09-24T11:16:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nelmi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nelmi/32/746978_2.png) [@nelmi](https://forums.unrealengine.com/u/nelmi)\
**Post date:** [September 24, 2023, 11:16am UTC](https://forums.unrealengine.com/t/how-to-check-for-all-of-a-maps-variables/1310147/1 "2023-09-24T11:16:48Z")

</div>

So I made a map which contains a logic variable for each player and I want to check if all of their variables are set to true instead of checking individually, do you know how to do this.

For example:  
if all variables of DidPlayerSurvive are true:  
Print(“All variables are true”)

This is how the map is initiated:

```auto
    var DidPlayerSurvive : [player]logic = map{}

```

---

<div class="post-metadata">

**Author:** ![LoPing](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/loping/32/737300_2.png) [@LoPing](https://forums.unrealengine.com/u/LoPing)\
**Post date:** [September 24, 2023, 11:55pm UTC](https://forums.unrealengine.com/t/how-to-check-for-all-of-a-maps-variables/1310147/2 "2023-09-24T23:55:11Z")

</div>

Maybe try something like…

```auto
    bDidTheySurvive(): logic=  
        for (Player: Self.GetPlayspace().GetPlayers()):
            if (var bIsurvived: logic = DidPlayerSurvive[Player]):
                if (bIsurvived = false):
                    return false
        return true
```

If any played didn’t survive ‘All Survived’ is false, otherwise it’s true. My code assumes that all players are assigned DidPlayerSurvive, otherwise an unassigned player is just ignored.
