How can I use the code below to deactivate a random barrier

Well have three barriers deactivating on channels 1, 2, or 3…

1 Like

Have barriers that receive on each channel that deactivate on that channel

Also, after the first integer, it has to be else if do’s or it won’t work.
All of the integers will run.
Do what blizzy said.

1 Like

It doesn’t work. All three barriers turn off

Barrier 1:
Deactivate on “1”

Barrier 2:
Deactivate on “2”

Barrier 3:
Deactivate on “3”

I did it but it doesn’t work

Oh, I see your problem

It’s your blockcode. It should be “else if” on the second 2 instead of “if”

i fixed that. Now this is my code
Screenshot 2023-12-13 10.55.59 AM

I tested it out and sometimes it doesn’t open a barrier or it does the same one

No! Don’t use Else! Use Else If! Else won’t work!

well, don’t you use else if you want to end the line of block code?

1 Like

It should be like this:
Set RF to Random Integer from 1 to 3
If RF = 1
Do:Broadcast on 1
Else If RF = 2
Do:Broadcast on 2
Else If RF = 3
Do:Broadcast on 3

It won’t detect the Else…
Trust me, I’ve done it with fishing…

huh, I didn’t know that… lol

1 Like

ummm it had the same issue. I replaced the else

1 Like

Can you give me a screenshot of your block?

did you put the channels into the barriers?

Screenshot 2023-12-13 11.01.09 AM