# How do i check to see if the Agent sent from an EliminatedEvent is False?

**URL:** <https://forums.unrealengine.com/t/how-do-i-check-to-see-if-the-agent-sent-from-an-eliminatedevent-is-false/836717>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [April 1, 2023, 4:17am UTC](https://forums.unrealengine.com/t/how-do-i-check-to-see-if-the-agent-sent-from-an-eliminatedevent-is-false/836717 "2023-04-01T04:17:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoshuaSavage904](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JoshuaSavage904](https://forums.unrealengine.com/u/JoshuaSavage904)\
**Post date:** [April 1, 2023, 4:17am UTC](https://forums.unrealengine.com/t/how-do-i-check-to-see-if-the-agent-sent-from-an-eliminatedevent-is-false/836717/1 "2023-04-01T04:17:14Z")

</div>

Hello, I’ve been stuck on this for hours now. I have a creature that spawns when entering an area and when you exit it despawns the problem is when it despawns it still triggers the elimination manager and drops the item. I only want the item to drop when eliminated by a player.

OnCreatureDespawn(Player: ?agent): void =

```
    if(Player?):
        Print("No camp reward")
    else:
        Print("Camp reward")

```

---

<div class="post-metadata">

**Author:** ![spentak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/spentak/32/642372_2.png) [@spentak](https://forums.unrealengine.com/u/spentak)\
**Post date:** [April 1, 2023, 4:39am UTC](https://forums.unrealengine.com/t/how-do-i-check-to-see-if-the-agent-sent-from-an-eliminatedevent-is-false/836717/2 "2023-04-01T04:39:29Z")

</div>

In your `OnCreatureDespawn`, I wouldn’t name that argument “Player” because we don’t know what it is that caused this. Just call it `Agent : ?agent`

Then, what I would try is casting the object to a player. If it succeeds, you know you have a player that caused the DeSpawn, otherwise it was something else.

ie

```auto
OnCreatureDespawn(Agent : ?agent) : void=
if (Player := player[Agent?]):
    # The agent was a player
    Print("No camp reward")
else:
    Print("Camp reward")

```

I didn’t test this, but should probably work with some fiddling.

---

<div class="post-metadata">

**Author:** ![JoshuaSavage904](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JoshuaSavage904](https://forums.unrealengine.com/u/JoshuaSavage904)\
**Post date:** [April 1, 2023, 4:42am UTC](https://forums.unrealengine.com/t/how-do-i-check-to-see-if-the-agent-sent-from-an-eliminatedevent-is-false/836717/3 "2023-04-01T04:42:35Z")

</div>

Thanks for the quick reply and suggestion ill give it a try

---

<div class="post-metadata">

**Author:** ![JoshuaSavage904](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JoshuaSavage904](https://forums.unrealengine.com/u/JoshuaSavage904)\
**Post date:** [April 1, 2023, 5:04am UTC](https://forums.unrealengine.com/t/how-do-i-check-to-see-if-the-agent-sent-from-an-eliminatedevent-is-false/836717/4 "2023-04-01T05:04:24Z")

</div>

Thank you so much!!!
