function ReadList(str) foundstr = nil for i=1,table.getn(SoundTable) do if string.Find(i,str) then foundstr = pl end end return foundstr end SoundTable = { "englich" = "vo/npc/male01/vanswer01.wav", "bs" = "vo/npc/male01/question26.wav"} if (SERVER) then function PlayerSounds( pl, text ) local fSound = ReadList(text) if fSound ~= nil then pl:EmitSound(fSound) end end hook.Add( "PlayerSay", "psounds", PlayerSounds );