TeamUpgradePurchased

Fires when a Team Upgrade is purchased from the Team Upgrade Shop.

Example usage:

Events.TeamUpgradePurchased(function(event)
    -- Only proceed if the MAGIC I upgrade was purchased
    if (event.upgrade == TeamUpgradeType.MAGIC_I) then
       local teamPlayers = event.team:getInGamePlayers()
       -- Loop over all players in the team that received the upgrade
        for i, player in pairs(teamPlayers) do
           -- Give each team player 5 telepearls
           InventoryService.giveItem(player, ItemType.TELEPEARL, 5)
        end
    end
end)

Parameters

player: Player

The player who purchased the team upgrade.

team: Team

The team that received the team upgrade.

The team upgrade that was purchased by the player.

Last updated