TeamUpgradePurchased

Fires when a Team Upgrade is purchased from the Team Upgrade Shop.
Example usage:
Events.TeamUpgradePurchase(function(event)
-- Only proceed if the Tier 3 Destruction upgrade was purchased
if (event.upgrade == TeamUpgrade.DESTRUCTION and event.tier == 3) 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 TNT blocks
InventoryService.giveItem(player, ItemType.TNT, 5)
end
end
end)

Parameters

player: Player

The player who purchased the team upgrade.

team: Team

The team that received the team upgrade.

upgrade: TeamUpgrade

The team upgrade purchased by the player.

tier: number

The tier of team upgrade purchased by the player.