Comment on page
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)
The player who purchased the team upgrade.
The team that received the team upgrade.
The team upgrade purchased by the player.
The tier of team upgrade purchased by the player.
Last modified 4mo ago