• Adding sound to printers?
    5 replies, posted
From another thread I grabbed this: [CODE] self.sound = CreateSound(self, Sound("ambient/levels/labs/equipment_printer_loop1.wav")) self.sound:SetSoundLevel(10) self.sound:PlayEx(1, 100)[/CODE] And I put this under: [CODE]function ENT:Initialize()[/CODE] For my printer, but it still does not make sound! Any ideas?
Why not using ENT:EmitSound() instead ? [CODE] self:EmitSound("ambient/levels/labs/equipment_printer_loop1.wav",100,100,1,CHAN_AUTO) [/CODE]
[QUOTE=Gedo789;47832825]Why not using ENT:EmitSound() instead ? [CODE] self:EmitSound("ambient/levels/labs/equipment_printer_loop1.wav",100,100,1,CHAN_AUTO) [/CODE][/QUOTE] Thanks bro! [editline]29th May 2015[/editline] On problem is that now it makes sound after its been removed so I added this in: [CODE]function ENT:OnRemove() Entity:StopSound( "ambient/levels/labs/equipment_printer_loop1.wav" ) end[/CODE] But still not working!
Read the function description (won't work with a file path): [url]http://wiki.garrysmod.com/page/Entity/StopSound[/url]
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
[QUOTE=code_gs;47834691]Read the function description (won't work with a file path): [url]http://wiki.garrysmod.com/page/Entity/StopSound[/url][/QUOTE] Ah ok thanks!
Sorry, you need to Log In to post a reply to this thread.