Playing a sound script


sound.Add{
	name = "gasrob_alarm",
	channel = CHAN_STATIC, 
	volume = 1,
	level = 100,
	pitch = 100,
	sound = GASROB.alarm,
}

How do I play it?


 
entity:EmitSound("gasrob_alarm")


incorrect

It’s correct and I’ve tested it. You really should post a ‘fix’ if you really think it’s wrong.

99% Sure I’m wrong, but



entity:EmitSound("gasrob.alarm")


Instead?


ent:EmitSound("GASROB.alarm")

?



sound.Add{
	name = 'soundtest',
	channel = CHAN_STATIC,
	pitch = 95,
	level = 100,
	volume = 1.0,
	sound = 'melonbomber/bottle_pop_2.wav' -- just a random .wav file I found
}

local soundtest = Sound('soundtest')
timer.Simple(10,function() -- Not necessary, just did it so I can hear it because I have to minimize my game
	sound.Play(soundtest, Vector(0,0,0)) -- Put whatever vector here...
end)


I just tested this out, too.