> For the complete documentation index, see [llms.txt](https://docs.easy.gg/scripting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.easy.gg/scripting/bedwars-scripting/events/teamupgradeerapurchased.md).

# TeamUpgradeEraPurchased

{% hint style="info" %}
This is a new event from the Season 10 update (April 5th, 2024)
{% endhint %}

Example usage:

```lua
Events.TeamUpgradeEraPurchased(function(event)
    -- Only proceed if the Diamond Era was purchased
    if (event.upgrade == TeamUpgradeEraType.DIAMOND_ERA) 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 a Diamond Scythe item
           InventoryService.giveItem(player, ItemType.DIAMOND_SCYTHE, 1)
        end
    end
end)
```

### Parameters

#### player: [Player](/scripting/bedwars-scripting/objects/player.md)

The player who purchased the team upgrade.

#### team: [Team](/scripting/bedwars-scripting/objects/team.md)

The team that received the team upgrade.

#### era: [TeamUpgradeEraType](/scripting/bedwars-scripting/types/teamupgradeeratype.md)

The team upgrade era purchased by the player.
