# How to get player who pressed UI button?

**URL:** <https://forums.unrealengine.com/t/how-to-get-player-who-pressed-ui-button/1695734>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [February 17, 2024, 8:10pm UTC](https://forums.unrealengine.com/t/how-to-get-player-who-pressed-ui-button/1695734 "2024-02-17T20:10:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![frenzyisegg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@frenzyisegg](https://forums.unrealengine.com/u/frenzyisegg)\
**Post date:** [February 17, 2024, 8:10pm UTC](https://forums.unrealengine.com/t/how-to-get-player-who-pressed-ui-button/1695734/1 "2024-02-17T20:10:42Z")

</div>

Trying to make a weapon selection UI. The actual UI is pretty simple but I can’t figure out how to grant one specific player(the one who pressed the button on the UI) the weapons from the granter. I don’t even know where to start so here’s the code I have so far:

```auto
    OG_Button.OnClick().Subscribe(OG_Pressed)
    New_Button.OnClick().Subscribe(New_Pressed)

    OG_Pressed(Message:widget_message):void =
        # Insert code that grants items to player who pressed button
        # Code below closes UI
        if (PlayerUI:player_ui = GetPlayerUI[Message.Player], MyUI: overlay = MyMap[Message.Player]?, SelectedButton: text_button_base = text_button_base[Message.Source]):
            PlayerUI.RemoveWidget(MyUI)
           if (MyMap[Message.Player] = false) {}
        return

    New_Pressed(Message:widget_message):void =
        # Insert code that grants items to player who pressed button
        # Code below closes UI
        if (PlayerUI:player_ui = GetPlayerUI[Message.Player], MyUI: overlay = MyMap[Message.Player]?, SelectedButton: text_button_base = text_button_base[Message.Source]):
            PlayerUI.RemoveWidget(MyUI)
           if (MyMap[Message.Player] = false) {}
        return

```

Any suggestions with how I would do this?
