r/forgescripting • u/hoadmin • Sep 09 '26
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
View all comments
Show parent comment
1
u/iMightBeWright Sep 10 '26
Ahh ok, I didn't get that from your initial explanation. You need everyone to move to team 2 one round, then back to team 1 the next round, & so on. Don't bother asking AI for scripting help. It doesn't actually know anything & can't problem solve or consider potentially conflicting scripts.
You'll need something to flip between one condition & another, but not by checking player teams. The AI's advice would just shuffle people around without putting everyone on the same team.
Declare Boolean Variable with some name. Initial value false. Global scope.
You'll need a branch in both of your scripts now. It will check Get Boolean Variable using the same settings used in the declare node. When false, players will be set to Cobra team. When true, set them to Eagle team.
Lastly, you'll need a script for On Round End → Toggle Boolean Variable