# Function not working for some reason and only a line of it actually runs

**URL:** <https://forums.unrealengine.com/t/function-not-working-for-some-reason-and-only-a-line-of-it-actually-runs/1255688>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [August 9, 2023, 1:51pm UTC](https://forums.unrealengine.com/t/function-not-working-for-some-reason-and-only-a-line-of-it-actually-runs/1255688 "2023-08-09T13:51:17Z")\
**Posts on this page:** 4\
**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:** [August 9, 2023, 1:51pm UTC](https://forums.unrealengine.com/t/function-not-working-for-some-reason-and-only-a-line-of-it-actually-runs/1255688/1 "2023-08-09T13:51:17Z")

</div>

The way it’s supposed to work is that when one of the buttons is pressed, it runs code inside the function PhoneRing(). When I playtest, the “Phone is ringing” message prints but the rest doesn’t do anything (btw OrderTimer runs on game start)

```auto
    OnBegin<override>()<suspends>:void=
        # TODO: Replace this with your code

        OrderTimer.SuccessEvent.Subscribe(PhoneRing)
        ButtonRestaurant1.InteractedWithEvent.Subscribe(OnOrderTaken)
        TakeOrderTimeout.SuccessEvent.Subscribe(PhoneStopRing)

```

```auto
    PhoneStopRing(Agent:?agent):void=
        ButtonRestaurant1.Disable
        ButtonRestaurant2.Disable
    
    PhoneRing(Agent:?agent):void=
        ButtonRestaurant1.Enable
        ButtonRestaurant2.Enable
        TakeOrderTimeout.Start()
        Print("Phone is ringing")

```

I’ve been stuck on this for a while. Can anyone help?

---

<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:** [August 9, 2023, 8:28pm UTC](https://forums.unrealengine.com/t/function-not-working-for-some-reason-and-only-a-line-of-it-actually-runs/1255688/2 "2023-08-09T20:28:32Z")

</div>

If ButtonRestaurant1, ButtonRestaurant2, and TakeOrderTimeout are @editable variables, are you sure you have them populated in the creative\_device you’ve put on your island? I’ve failed to do this a few times.

---

<div class="post-metadata">

**Author:** ![DustinREDGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dustinredgames/32/634988_2.png) [@DustinREDGames](https://forums.unrealengine.com/u/DustinREDGames)\
**Post date:** [August 9, 2023, 8:33pm UTC](https://forums.unrealengine.com/t/function-not-working-for-some-reason-and-only-a-line-of-it-actually-runs/1255688/3 "2023-08-09T20:33:50Z")

</div>

The `Enable` and `Disable` method calls are missing the `()`, they should be called like this:

```auto
ButtonRestaurant1.Enable()
ButtonRestaurant2.Enable()

ButtonRestaurant1.Disable()
ButtonRestaurant2.Disable()

```

Also make sure after Verse changes to recompile using:  
**UEFN Menu \> Verse \> Build Verse Code**

---

<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:** [September 8, 2023, 8:33pm UTC](https://forums.unrealengine.com/t/function-not-working-for-some-reason-and-only-a-line-of-it-actually-runs/1255688/4 "2023-09-08T20:33:54Z")

</div>

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