Toggle music

Im having trouble making some sounds toggle, ive got a picture of the settings here:
Ive set it to toggle in the flags setting


it plays but when i press the button again to turn it off it stops for a second starts again from the begining

Try turning off the toggle flag for the buttons.

Nope that doesn’t seem to have done any effect, but thanks.

i have this problem too (I’m ignoring it like a smart man :3:) but im pretty sure you can make a toggle system through the button’s toggle and two “logic_relay” entities.

i was looking for a simple way…mabye i can have 2 buttons one starting it and one stopping using different outputs?

In the Output tab of one of your func_button’s, add a following Output:
OnIn targetname PlaySound

And another Output

OnOut targetname StopSound

Works for me.

And in the Flags tab, check the flags Toggle and Use Activates

Also ambient_generics by default have the flag ‘does not loop’ ticked. Remember to untick that. :biggrin:

Sorry that hasn’t worked, i will try to untick that “does not loop” box see what happens

Edit: THANK YOU it has worked! The doesn not loop box was the problem