Hello!
I know this is a basic question but I still do not understand how to do this.
What I want to do is if the agent push the button change the Maximum health of the agent’s team.
Thank you in advance!
Hello!
I know this is a basic question but I still do not understand how to do this.
What I want to do is if the agent push the button change the Maximum health of the agent’s team.
Thank you in advance!
Hey, you can use fort_team_collection
to do this, something like
TeamCollection := GetPlayspace().GetTeamCollection()
if(
PlayerTeam := TeamCollection.GetTeam[Player],
PlayerAllies := TeamCollection.GetAgents[PlayerTeam]
):
for(Ally : PlayerAllies):
# DO STUFF
Be careful, the fort_team_collection.GetAgents[]
method returns agents (creatures/guards…) not players, so you might need to cast them to players if you only want to change the players health.
Thank you for your reply LAMA-san!
Is there any way to get the index of the team?
I can get the type :team but I dont know how to get the team1 or team2.
Thank you again
Hey, so I don’t know an easy way to do it, but you could do try that :
TeamCollection := GetPlayspace().GetTeamCollection()
if(
PlayerTeam := TeamCollection.GetTeam[Player],
VerseTeamIndex := TeamCollection.GetTeams().Find[PlayerTeam],
CreativeTeamIndex := VerseTeamIndex + 1 # Array indexes start from 0, creative team indexes start from 1
):
# DO STUFF
Your indent is wrong
Yes I know, it’s pretty easy to solve but I’ll let you find how, good luck
I could fix by my self thank you very much!!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.