Entity leaving the team event||doc135526
September 20, 2022
- The class to which the function belongs:
- Call limit:
This event is fired when an entity joins a team.
The context content of the event
|obj1||Entity||Instances of entities entering the team|
|teamId||int||Entering team ID|
Trigger.RegisterHandler(this:cfg(), "JOIN_TEAM", function(context) local entity = context.obj1 local joinTeam = Game.GetTeam(context.teamId) -- get the team to join entity:setProp('maxHp', 60) -- set the maximum health of the entity local maxHP = entity:prop('maxHp') print(maxHP) end)
Add registered entities when entering the game
Callback, create a team, add entities to the team, trigger
Enter the team callback function
Trigger.addHandler(this:cfg(), "ENTITY_ENTER", function(context) local entity = context.obj1 Local team = Game.CreateTeam() -- create a team Game.TryJoinTeamByPlayer(entity, team.id) -- adding the entity to the team will trigger the above join team event end)
[BMGC] Copyright Infringement Claim Garena wholly respects the intellectual property rights of others and does not tolerate the infringement of these rights on our platform. As outlined in our Terms of Service, we will review reports of infringing content and remove content from our platform where necessary.
[BMGC] Creator Contest Rules Dear creators, you're invited to participate in the Blockman Creator Contest. This creator contest is organized across the globe and your game will be played by players from around the world! Submitted games will be evaluated in the Game Submission and Game Evaluation stages, and the winners will get attractive prizes. If you are interested in participating in this contest, please take note of the following contest rules and regulations.