My First Expression 2 help

im making a turret so when u go in front of the ranger the turret go’s off

@name Auto Turret
@inputs Ranger
@outputs Fire

If (Ranger>=1) {Fire=1}
If (Ranger<=0) {Fire=0}

please tell me if this is right

have you tried it alredy?

not yet but soon

That could work, however…

@name Auto Turret
@inputs Ranger
@outputs Fire 

If (Ranger>=1) {Fire} else

And I’m not completely sure that will work but I think it will.


I understand that you’re using this as practice, but it’s not needed at all. You could just wire the turret directly to the ranger. :slight_smile:


Expression 2 tutorials:
ApplyForce tutorial:
The wiki:


Why did you make a new thread?

o sorry 0_0


no it don’t work


but replace {!Fire} With {Fire=0} and it will work

And Fire with Fire = 1

but if i do {Fire=1} it will always stay on right

Not if you put “else {Fire = 0}” after that.


now i need help making an auto door
i need a link for wire door
and normal door