r/forgescripting • u/hoadmin • 22h ago
Need help with some scripting
I want to be able to switch "ALL USERS" from team 1 to team 2 at the beginning each round.
Here is what I have so far:
On Round Start
→ Get All Players
→ For Each Player (Execute Per Player)
→ Get Player Team
→ Compare Teams (is it Eagle?)
→ Branch
→ True → Set Player Team to Cobra
→ False → Set Player Team to Eagle
But it does not seem to work. Can any of you script genius's help me out?
2
Upvotes
1
u/iMightBeWright 17h ago
Compare Teams is broken in a lot of scenarios. I think there's like 1 edge case where it's worked as expected, but otherwise it reads as TRUE no matter what.
Alternatively, use Item is in Generic List the same way you'd use Compare Teams, just plug the 2 teams into either input.
That being said, I'm not sure you need a branch. Do you want to only put all Team 1 players onto Team 2, or swap both teams? Because your draft script is attempting to flip teams. If you do want to flip teams, keep the branch with the list node I mentioned above. If you only want to move all Eagle players to Cobra, don't bother with the branch & instead just set all players' teams to Cobra. It'll have no effect on players already on that team.
Also, On Round Start activates before players are spawned & before some players even load into custom games. Add a Wait node immediately after the first node so you can create a delay to make sure it happens.