• Sound Table Problem
    3 replies, posted
im having a problem with my SWEP, and its not that big. the SWEP is supposed to play one out of the Eleven sounds listed randomly when one primary fires. but what i get in console when i try to do so is this: tryed to call "Emitsound", entity expected, got string. here is the SWEP- (only table and primary fire shown) [lua] //--table local SoundTable = { "weapons/tguy/y1.mp3", "weapons/tguy/y2.mp3", "weapons/tguy/y3.mp3", "weapons/tguy/y4.mp3", "weapons/tguy/y5.mp3", "weapons/tguy/y6.mp3", "weapons/tguy/y7.mp3", "weapons/tguy/y8.mp3", "weapons/tguy/y9.mp3", "weapons/tguy/y10.mp3", "weapons/tguy/y11.mp3", } //--primary fire function SWEP:PrimaryAttack() self:EmitSound(table.Random( SoundTable ) ); end [/lua]
self.Owner:EmitSound(...)
self.Owner:EmitSound(table.Random( SoundTable ) ); so that?
[QUOTE=Kruel Kramer;24374378]self.Owner:EmitSound(table.Random( SoundTable ) ); so that?[/QUOTE] Yes.
Sorry, you need to Log In to post a reply to this thread.