# Verse Select all trigers and add to tracker

**URL:** <https://forums.unrealengine.com/t/verse-select-all-trigers-and-add-to-tracker/1609435>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite\
**Created:** [January 12, 2024, 7:49pm UTC](https://forums.unrealengine.com/t/verse-select-all-trigers-and-add-to-tracker/1609435 "2024-01-12T19:49:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![miroslavresa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@miroslavresa](https://forums.unrealengine.com/u/miroslavresa)\
**Post date:** [January 12, 2024, 7:49pm UTC](https://forums.unrealengine.com/t/verse-select-all-trigers-and-add-to-tracker/1609435/1 "2024-01-12T19:49:55Z")

</div>

Hi,  
I have a lot of triggers on the map and I want to select them all (a tag is placed on triggers) and add them automatically to the tracker in place “incremental progress”.  
I need to use verse for this.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/2/f/72fdf7821e5bf40334c602d35c31d180aa898745.png)

Thanks

---

<div class="post-metadata">

**Author:** ![EisStudios](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eisstudios/32/885240_2.png) [@EisStudios](https://forums.unrealengine.com/u/EisStudios)\
**Post date:** [January 17, 2024, 5:10pm UTC](https://forums.unrealengine.com/t/verse-select-all-trigers-and-add-to-tracker/1609435/2 "2024-01-17T17:10:02Z")

</div>

You’d want to create a tag, mark the trigger devices with the tag. Then go through every device with a for loop, and subscribe to the .TriggeredEvent(). Then, call another function, which will increment the tracker. In my case, it looks like this:

```auto
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Verse.org/Simulation/Tags }

triggers := class(tag){}

trigger_increment := class(creative_device):
    @editable Tracker : tracker_device = tracker_device { }
    
    OnBegin<override>()<suspends>:void=
        for (TriggerObject : GetCreativeObjectsWithTag(triggers{}), 
            Trigger := trigger_device[TriggerObject]):
                Trigger.TriggeredEvent.Subscribe(OnTrigger)

    OnTrigger(MaybeAgent : ?agent):void=
        if (Agent := MaybeAgent?):
            Tracker.Increment(Agent)

```

---

<div class="post-metadata">

**Author:** ![miroslavresa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@miroslavresa](https://forums.unrealengine.com/u/miroslavresa)\
**Post date:** [January 17, 2024, 8:56pm UTC](https://forums.unrealengine.com/t/verse-select-all-trigers-and-add-to-tracker/1609435/3 "2024-01-17T20:56:24Z")

</div>

Thanks, I have one more question if you can help me.  
When it comes to multiplayer, I need when a player activates the trigger, the trigger is deactivated for that player, but others players can activate it, and of course for each player who activates it after that trigger deactivated for him.

---

<div class="post-metadata">

**Author:** ![EisStudios](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eisstudios/32/885240_2.png) [@EisStudios](https://forums.unrealengine.com/u/EisStudios)\
**Post date:** [January 17, 2024, 10:01pm UTC](https://forums.unrealengine.com/t/verse-select-all-trigers-and-add-to-tracker/1609435/4 "2024-01-17T22:01:06Z")

</div>

As far as I know, it’s not possible to locally show the trigger being disabled - meaning, that visually it will be the same for every person in the server. I might be wrong though.

What you can do, is add the players to a map when they trigger the device. If they then again try to trigger the device, you check the map for their name. If it exists, they’ve already triggered the device, so therefore we just ignore the trigger. Otherwise, we can pursue as we would normally.

Hope that makes sense.

> **[Map](https://dev.epicgames.com/documentation/en-us/uefn/map-in-verse)**
>
> A map is a container where you can store values associated with other values, called key-value pairs, and access the elements by their unique keys.
