Random way to go to spectator or a different team

hi, I’m making a game, and i need help with a certain thing, can you make it so if a player get K.O’ed, that they have a random chance to go to spectator or a different team?

(Lifecycle) Player Knocks Out —> (Trigger) Trigger

Put these blocks in the Trigger: (follow this guide)

Set [Variable] to random integer from # to #
if [Variable] = #
do Broadcast Message On Channel “switchspectator”

else if [Variable] = #
         do Broadcast Message On Channel “switchteam”

Note: in the “set variable to random integer from # to #” part, using two integers is recommended.

also, make them broadcast on channels on two team switcher’s “switch team when receiving on” channel.
There’s a picture explanation in the comments below

Use Lifecycle, Trigger, and 2 Team Switchers.
Lifecycle settings:
Screenshot 2024-01-09 4.46.08 PM
Then go make blocks in the Trigger like this:
Screenshot 2024-01-09 4.52.34 PM
First Team Switcher settings:
Screenshot 2024-01-09 4.58.28 PM
For the other Team switcher:
Screenshot 2024-01-09 5.01.09 PM
You can make it any team you want just don’t make it a spectator. Then put a wire from the lifecycle to trigger:

Then you’re done! I hope this helps!


Remember to mark a solution @Kadenracer987 if your question is answered.

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.