# Code error when following Verse Guide.

**URL:** <https://forums.unrealengine.com/t/code-error-when-following-verse-guide/818422>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite\
**Created:** [March 24, 2023, 8:51pm UTC](https://forums.unrealengine.com/t/code-error-when-following-verse-guide/818422 "2023-03-24T20:51:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan.Gregg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ryan.Gregg](https://forums.unrealengine.com/u/Ryan.Gregg)\
**Post date:** [March 24, 2023, 8:51pm UTC](https://forums.unrealengine.com/t/code-error-when-following-verse-guide/818422/1 "2023-03-24T20:51:36Z")

</div>

I am following this \> [2. Defining the Pickup and Delivery Zones](https://dev.epicgames.com/documentation/en-us/uefn/pizza-pursuit-2-defining-the-pickup-and-delivery-zones-in-verse)

My issue is I’m not having any luck with the following pieces of code VS isn’t happy with.

`spawn { WaitForZoneCompleted(option{CaptureArea.PlayerEntersEvent}) }`  
`spawn { WaitForZoneCompleted(option{ItemSpawner.ItemPickedUpEvent}) }`

Any ideas why it isn’t happy with these. one of the warnings says, “Unknown member `PlayerEntersEvent` in `capture_area_device`.” The other says, “This function parameter expects a value of type ?awaitable(player), but this argument is an incompatible value of type ?listenable(agent).”

Any help would be excellent.

---

<div class="post-metadata">

**Author:** ![UltimateLambda](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ultimatelambda/32/916183_2.png) [@UltimateLambda](https://forums.unrealengine.com/u/UltimateLambda)\
**Post date:** [March 24, 2023, 9:49pm UTC](https://forums.unrealengine.com/t/code-error-when-following-verse-guide/818422/2 "2023-03-24T21:49:06Z")

</div>

TLDR: update `WaitForZoneCompleted` to take a `?listenable(agent)` (or even just `?awaitable(agent)`). In `WaitForZoneCompleted`, you will likely have to cast the result of `Await` to `player` - e.g. `Player := player[Event.Await()]` - but only do this if you really need a `player`, and an `agent` isn’t good enough. Long answer: `WaitForZoneCompleted` is likely defined with argument `?awaitable(player)`. However, many of the events produce an `agent` - i.e., they are defined as `listenable(agent)`. `player` and `agent` do have a subtyping relationship - but `agent` is a supertype of `player`. Because `WaitForZoneCompleted` states it must have a `player` - that an `agent` isn’t good enough - passing a `?listenable(agent)` isn’t good enough.

---

<div class="post-metadata">

**Author:** ![DiG3](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dig3/32/1036114_2.png) [@DiG3](https://forums.unrealengine.com/u/DiG3)\
**Post date:** [March 24, 2023, 9:57pm UTC](https://forums.unrealengine.com/t/code-error-when-following-verse-guide/818422/3 "2023-03-24T21:57:01Z")

</div>

Hey Ryan, thanks for catching this.  
We’re going to update that tutorial soon to integrate some fixes.  
In the meantime, I’m attaching a zip with the updated code.  
[PizzaPursuitFixed.zip](https://forums.unrealengine.com/uploads/short-url/rurY3iM6vfYcWGJR3gEASGVeDmj.zip) (7.2 KB)

Please let us know if you encounter any other issues 🙂

---

<div class="post-metadata">

**Author:** ![Ryan.Gregg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ryan.Gregg](https://forums.unrealengine.com/u/Ryan.Gregg)\
**Post date:** [March 24, 2023, 11:12pm UTC](https://forums.unrealengine.com/t/code-error-when-following-verse-guide/818422/4 "2023-03-24T23:12:52Z")

</div>

Hi,

I was wondering when that update will happen. I have identified other parts of the tutorial that are not correct. The only method to correct these issues is using what you have supplied.

With a complete beginner to C++ and Verse this would cause a lot of confusion. In terms of someone who know some C++ not so bad but still confusing, and Verse is a different language in some ways eyc.
