Advice regarding 2 buttons toggling

BakaOsaka

L1: Registered
Apr 22, 2012
3
0
Hi, I need some advice for my Team Fortress 2 map.

I have 2 ondamage brush-based button entities on my map. Button1 plays sound1, and button2 plays sound2. Currently if you activate button2 whilst sound1 is playing, it stops sound1 and plays sound2.
However, I have a problem. This means that if you shoot button1 and button2 in rapid succession, you can rapidly change the sounds. What I want to do is make it so that if you activate button1, sound1 will play but also add a delay so that button2 cannot be activated for a certain period of time, and vice versa. However, I am unable to work out how to do this. Can somebody offer me some advice?

Any help would be appreciated.
 

BakaOsaka

L1: Registered
Apr 22, 2012
3
0
Hi,

I have just tried doing that and sadly it doesn't work. Here is the outputs on my button (I haven't added an unlock yet as I wanted to confirm it'd work first)

2p9Ei.png


However, it seems to function exactly the same as if the lock function isn't there.

Any other advice?
Thanks.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Ah, I believe the OnDamaged output bypasses locking, because locking only stops the button from being pressed. You should be able to work around it by making the damage press the button, rather than do the action directly.

for btn2:
Output|Target|Input
OnDamaged|btn2|Press
OnPressed|sound2|PlaySound
OnPressed|btn1|Lock