local sounds = { // Team does not need to be present. // [ "text in chat" ] = { Sound = "soundname", Team = { number, number2 } } [ "laffo" ] = { Sound = "lolwut.sound", Team = { 999 } } } local function PlayerSay( ply, text, public ) for word, info in pairs( sounds ) do if ( !info.Team || table.HasValue( info.Team, ply:Team() ) ) then if ( string.Left( string.lower( text ), string.len( word ) ) == string.lower( word ) ) then ply:EmitSound( info.Sound or "" ) end end end end hook.Add( "PlayerSay", "ChatSounds.PlayerSay", PlayerSay )