Empty ambient_generic?

SV_CHEATS 1

L1: Registered
Feb 20, 2012
16
0
I spawned an ambient generic, set the keyvalues correctly and executed the playsound input but it said "empty ambient_generic" and the sound will not play. Is this code correct?


ent_create ambient_generic
ent_fire ambient_generic addoutput "targetname sound"
ent_fire sound addoutput "classname sound"
ent_fire sound addoutput "target music\HL2_song15.mp3"
ent_fire sound addoutput "health 10"
ent_fire sound addoutput "volstart 10"
ent_fire sound addoutput "fadein 0"
ent_fire sound addoutput "fadeout 0"
ent_fire sound addoutput "spawnflags 1"
ent_fire sound playsound

how do I get the sound to correctly play?
 

Seba

DR. BIG FUCKER, PHD
aa
Jun 9, 2009
2,364
2,728
Create the ambient_generic in Hammer instead of spawning it in-game?