Verse Library verse

03 Snippet

Grants a specific tiered weapon to a player by retrieving the corresponding item granter device from an array and triggering it.

extracted-snippets/documentation/en-us/fortnite/team-elimination-3-subscribing-to-player-events-in-verse/03-snippet.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/team-elimination-3-subscribing-to-player-events-in-verse
# Local doc:  epic-docs/documentation/en-us/fortnite/team-elimination-3-subscribing-to-player-events-in-verse.md
GrantWeapon(InPlayer : ?agent, WeaponTier : int) : void=
Print("Granting Player a weapon of Tier {WeaponTier}")
if(ItemGranter := WeaponGranters[WeaponTier], GrantedPlayer := InPlayer?):
ItemGranter.GrantItem(GrantedPlayer)

Comments

    Sign in to vote, comment, or suggest an edit. Sign in