Adding sound to printers?

From another thread I grabbed this:

	self.sound = CreateSound(self, Sound("ambient/levels/labs/equipment_printer_loop1.wav"))
	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 ?


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" )

But still not working!

Read the function description (won’t work with a file path):

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!