# How to use Player-Counter-Device properly?

**URL:** <https://forums.unrealengine.com/t/how-to-use-player-counter-device-properly/1352547>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [October 30, 2023, 1:15pm UTC](https://forums.unrealengine.com/t/how-to-use-player-counter-device-properly/1352547 "2023-10-30T13:15:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Messiah4213](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/messiah4213/32/764721_2.png) [@Messiah4213](https://forums.unrealengine.com/u/Messiah4213)\
**Post date:** [October 30, 2023, 1:15pm UTC](https://forums.unrealengine.com/t/how-to-use-player-counter-device-properly/1352547/1 "2023-10-30T13:15:19Z")

</div>

Hello!  
I want to make the Verse code that if player is inside the zone of Player\_Counter\_device, Its going to print “Player inside” but it doesnt work at all.  
Whats wrong with this code?  
Thank you!  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/d/c/edc184b80343083de3aa94dc5b33ee6ca501b0ef.png)

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [October 30, 2023, 2:08pm UTC](https://forums.unrealengine.com/t/how-to-use-player-counter-device-properly/1352547/2 "2023-10-30T14:08:24Z")

</div>

Your Healing function does not suspend, meaning the loop is basically an **infinite loop** , it will try to compute your code infinitely in a single frame

Maybe you can try to call a **suspending** `HealingSuspends()` function instead and add a` Sleep(0.0)` inside your loop

---

<div class="post-metadata">

**Author:** ![Messiah4213](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/messiah4213/32/764721_2.png) [@Messiah4213](https://forums.unrealengine.com/u/Messiah4213)\
**Post date:** [October 30, 2023, 2:24pm UTC](https://forums.unrealengine.com/t/how-to-use-player-counter-device-properly/1352547/3 "2023-10-30T14:24:25Z")

</div>

Thank you for your reply LAMA  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/d/30d2b881f9fb3e8e8bcd548ff55e16323e2a0468.png)  
I make it not infinite loop but Its still not working…  
I shoudnt use IsCounted?  
When I enter the device its shows like this↓  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/1/5/d15ed416e0ea2aceba845c2ab261087f0c0476f9.png)

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [October 30, 2023, 2:31pm UTC](https://forums.unrealengine.com/t/how-to-use-player-counter-device-properly/1352547/4 "2023-10-30T14:31:44Z")

</div>

Yup it’s strange, maybe you can subscribe to this function instead of using `IsCounted` :

```auto
# Sends the `agent` that is no longer being counted.
RemovedEvent<public>:listenable(agent) = external {}

```

---

<div class="post-metadata">

**Author:** ![Messiah4213](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/messiah4213/32/764721_2.png) [@Messiah4213](https://forums.unrealengine.com/u/Messiah4213)\
**Post date:** [October 30, 2023, 2:40pm UTC](https://forums.unrealengine.com/t/how-to-use-player-counter-device-properly/1352547/5 "2023-10-30T14:40:01Z")

</div>

Sorry for many question.  
Is there any way to break the looping of other method?  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/1/a/f1a72cfd16b36d17b37336c89ea8de814a1b335b.png)

If I subscribe the HealingStop, I can not effect other method…

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [October 30, 2023, 2:42pm UTC](https://forums.unrealengine.com/t/how-to-use-player-counter-device-properly/1352547/6 "2023-10-30T14:42:46Z")

</div>

You could use a `[player]logic` **map** and change its value inside `HealingStop` function, instead of `something` you’d do

```auto
if(MyMap[Player]?):
    break

```

---

<div class="post-metadata">

**Author:** ![Messiah4213](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/messiah4213/32/764721_2.png) [@Messiah4213](https://forums.unrealengine.com/u/Messiah4213)\
**Post date:** [October 30, 2023, 2:57pm UTC](https://forums.unrealengine.com/t/how-to-use-player-counter-device-properly/1352547/7 "2023-10-30T14:57:14Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/5/3/b53acdd367efcf04df2ae79b92002d05589a3a26.png)  
It worked! thank you!!

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [October 30, 2023, 4:10pm UTC](https://forums.unrealengine.com/t/how-to-use-player-counter-device-properly/1352547/8 "2023-10-30T16:10:02Z")

</div>

You’re welcome, but your code won’t work in multiplayer, since you’re resetting the map everytime, you have to assign the value of map, not the whole map, something like

```auto
option{set HealingLogic[Player] = false}

```

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [November 29, 2023, 4:10pm UTC](https://forums.unrealengine.com/t/how-to-use-player-counter-device-properly/1352547/9 "2023-11-29T16:10:12Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
