UEFN - Could i have some help for a host value

I would like to retrieve the value of the person who launches a custom map (the host).

I would like that when I start my game, only I can collect 3 weapons.

is it possible?

Thank you for your help.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Fortnite.com/Teams }
using { /Fortnite.com/Game }
using { /Fortnite.com/Playspaces }
using { /Fortnite.com/Characters }
using { /UnrealEngine.com/Temporary/Diagnostics }

# A Verse-authored creative device that can be placed in a level
game_manager := class(creative_device):

    var PlayerMap : [player]int = map{}

    @editable
    var WeaponGranters : []item_granter_device = array{}

    @editable
    var Sentries : []sentry_device = array{}

    # Runs when the device is started in a running game
    OnBegin<override>()<suspends>:void=
        InitPlayers()

    InitPlayers() : void=
        Playspace: fort_playspace = GetPlayspace()
        AllPlayers: []player = Playspace.GetPlayers()
        if (FirstPlayer : player = AllPlayers[0]):
            if (FortniteCharacter : fort_character = FirstPlayer.GetFortCharacter[]):
                Print("Grant Weapon to First Player")
                GrantWeapon(FirstPlayer, 0)
                GrantWeapon(FirstPlayer, 1)
                GrantWeapon(FirstPlayer, 2)

    GrantWeapon(Player : player, WeaponTier: int) : void=
        Print("to grant Weapon")
        if (ItemGranter  := WeaponGranters[WeaponTier]):
            Print("granted")
            ItemGranter.GrantItem(Player)

I still haven’t found an answer to my problem. :sob:

:pray:

Hi Nocktis,

I don’t believe in Verse there’s a reliable way to do this unless there’s some existing Creative device with this functionality. That said, depending on what you’re trying to do you could have a button or something in the world that performed this function a limited number of times. Or you could do some kind of in-game team selection where the different teams get different sets of items via code.