Adding sound to printers?

From another thread I grabbed this:


	self.sound = CreateSound(self, Sound("ambient/levels/labs/equipment_printer_loop1.wav"))
	self.sound:SetSoundLevel(10)
	self.sound:PlayEx(1, 100)

And I put this under:


function ENT:Initialize()

For my printer, but it still does not make sound! Any ideas?

Why not using ENT:EmitSound() instead ?



self:EmitSound("ambient/levels/labs/equipment_printer_loop1.wav",100,100,1,CHAN_AUTO)


Thanks bro!

[editline]29th May 2015[/editline]

On problem is that now it makes sound after its been removed so I added this in:


function ENT:OnRemove()
	Entity:StopSound( "ambient/levels/labs/equipment_printer_loop1.wav" )
end

But still not working!

Read the function description (won’t work with a file path): http://wiki.garrysmod.com/page/Entity/StopSound

sound created before a player joins like that means the sound doesn’t play I think you need to for example net.Send the entity to player on join and also create sound on client

Ah ok thanks!