Power help in my game

so in my newest game I need it to give the player a random type when they respawn
Types
Light
Healer
Heavy
Normal

Random “classes” or smth?

So you need help with a randomizer?

1 Like

You can alter things from here:

1 Like

yes Preformatted text

Each time they respawn they get a new role? Or just roles at the start of the game?

1 Like

each time the respawn and at the start of the game

Why would you want them to switch roles each time they respawn? (just a bit curious)

1 Like

it for my fighting game. it just a mix of improved Streak Savers and Snowbrawl but with powers for me and my friends to play because we cant play discovery until 4pm

1 Like

Here’s the code:

Set variable "var" | Random integer (1) to (4)
If [var] ≠ [team number] then
   Broadcast message on channel | var
Else
   Broadcast message on channel | Recursion channel

Team switchers receive 1, 2, 3, 4 and switch player to that team, respectively. The recursion channel makes sure they aren’t on the same team. That channel retriggers the trigger so it runs the code again.

1 Like

ok thanks for the code should this go In a trigger

Sure! Just make sure it is linked to a lifecycle for when player is knocked out!

1 Like

what device should recursion channel go in and were

It should go in the “trigger when receiving on” channel slot in the trigger that runs the block code.

1 Like

and what about var channel

In the team switchers. “Switch when receiving on”

2 Likes

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