put $mytrigger nottriggerable at the top of the thread that opens the bridge and then put $mytrigger triggerable at the end after it is open . That is if you are useing setthread or you can just run a loop .
bridge_thread:
level.bridgeopen = 0
while(1)
{
$mytrigger waittill trigger
if(level.bridgeopen == 0)
{
$mytrigger nottriggerable //i added this as i think maybe u could keep pressing it and it would rotate out place
waitthread open_bridge
level.bridgeopen = 1
$mytrigger triggerable
}
else
{
$mytrigger nottriggerable //i added this as i think maybe u could keep pressing it and it would rotate out place
waitthread close_bridge
level.bridgeopen = 0
$mytrigger triggerable
}
}
end
open_bridge:
$switchspeaker playsound alarm_switch //makes a nice click
wait .5
$bridgespeaker loopsound lighthouse_run //whirrrrr
$rightsidebridge rotatez -20
$leftsidebridge rotatez 20 //rotates
wait 3.5
$rightsidebridge rotatez 0 //stops rotation
$leftsidebridge rotatez 0
$bridgespeaker loopsound lighthouse_run wait //stops whirrrrr
$switchspeaker playsound alarm_switch //makes a nice clicky sound
end
close_bridge: //seperated out from the first thread so u are able to open and close it from the trigger
$bridgespeaker loopsound lighthouse_run //whirrrrr
$rightsidebridge rotatez 20
$leftsidebridge rotatez -20 //rotates
wait 3.5
$rightsidebridge rotatez 0 //stops rotation
$leftsidebridge rotatez 0
$bridgespeaker loopsound lighthouse_run wait //stops whirrrrr
$switchspeaker playsound alarm_switch //makes a nice clicky sound
end
If Z does not rotate it the right way, try X or Y--or negitive numbers. With these commands you do not have to time the move and then stop it. The time it takes them to move can be set with the command "time"--like this.
$rightsidebridge time 2.5
$leftsidebridge time 2.5
That only has to be set once, unless you want to change the travel time for some reason.
I see you have your trigger using a setthread, That is not needed for a trigger_use because the thread will auttomattically wait for the trigger to be used. Put "thread bridge_thread" under "level waittill prespawn" to start the thread waiting. Then this line will make it wait.
$mytrigger waittill trigger // "mytrigger" would be the targetname of your trigger_use.
You can also put that line more than once in a thread.
$mytrigger waittill trigger
//do the open lines $mytrigger waittill trigger
//do the close lines
So your trigger will both open and close the bridge. But it might be better to just put in a wait line and have it close by itself.
$mytrigger waittill trigger
//do the open lines wait 5
//do the close lines
So, here is a thread that will do the same as you had it--almost.
I managed to comprehend it on the 4th read through!
Thanks t|trude! I knew there was a rotate simple one, but i couldnt find it!
My map, (with two of Elgans scripted bridges (it works, and i dont want to jepordise it )) FastAndFurious2 will be on later tonight, and i will post it in the review section for those who wish to view it (and i would like a review )