-- name: !Blither's Chat Sounds -- description: !Blither's Chat Sounds v1.0\nBy \\#417B16\\Blither\\#7B1619\\Dev\n\n\\#dcdcdc\\Saying one of your character's voicelines will play it! Saying "mama mia" will play the sound! There are others,but you can check it with the /voicelines command! local function first_existing_sound(names) for _, n in ipairs(names) do local v = _G[n] if v then return v, n end end return nil, nil end local triggers = { { keywords = {"mama mia","mamma mia"}, sounds = {"CHAR_SOUND_MAMA_MIA"} }, { keywords = {"yahoo"}, sounds = {"CHAR_SOUND_YAHOO"} }, { keywords = {"game over"}, sounds = {"CHAR_SOUND_GAME_OVER"} }, { keywords = {"ima tired","im tired","i'm tired","i am tired"}, sounds = {"CHAR_SOUND_IMA_TIRED"} }, { keywords = {"on fire","i'm on fire","im on fire","screamfire"}, sounds = {"CHAR_SOUND_ON_FIRE"} }, { keywords = {"hrm","hrmm","gngg","hmmm"}, sounds = {"CHAR_SOUND_HRMM"} }, { keywords = {"here we go","herewego"}, sounds = {"CHAR_SOUND_HERE_WE_GO"} }, { keywords = {"boing"}, sounds = {"CHAR_SOUND_TWIRL_BOUNCE"} }, { keywords = {"hello","hi","hi everybody"}, sounds = {"CHAR_SOUND_HELLO"} }, { keywords = {"okey dokey","lets go","let's go","good choice"}, sounds = {"CHAR_SOUND_OKEY_DOKEY"} }, { keywords = {"haha","lol","lmao"}, sounds = {"CHAR_SOUND_HAHA"} }, { keywords = {"zzz","snore","sleep"}, sounds = {"CHAR_SOUND_SNORING1"} }, { keywords = {"cough","sick"}, sounds = {"CHAR_SOUND_COUGHING1"} }, { keywords = {"ahhhh","falling","help me"}, sounds = {"CHAR_SOUND_WAAAOOOW"} }, { keywords = {"doh","oops","my bad"}, sounds = {"CHAR_SOUND_DOH"} }, { keywords = {"so long","bye","goodbye"}, sounds = {"CHAR_SOUND_SO_LONGA_BOWSER"} }, { keywords = {"press start to play","you ready to play"}, sounds = {"CHAR_SOUND_PRESS_START_TO_PLAY"} }, { keywords = {"lets a go","let's a go"}, sounds = {"CHAR_SOUND_LETS_A_GO"} }, { keywords = {"uh","grunt"}, sounds = {"CHAR_SOUND_UH"} } } hook_event(HOOK_ON_CHAT_MESSAGE, function(m, msg) if not msg then return end local s = msg:lower() for _, t in ipairs(triggers) do for _, kw in ipairs(t.keywords) do local safe_kw = kw:gsub("([%%%^%$%(%)%.%[%]%*%+%-%?])", "%%%1") if s:find("%f[%w]" .. safe_kw .. "%f[%W]") then local sound, name = first_existing_sound(t.sounds) if sound and m and m.marioObj and m.marioObj.header and m.marioObj.header.gfx then if name:find("CHAR_SOUND") then play_character_sound(m, sound) else play_sound(sound, m.marioObj.header.gfx.cameraToObject) end end return end end end end) hook_chat_command("voicelines", "Shows all available keywords for voicelines", function(msg) local all_keywords = {} for _, t in ipairs(triggers) do for _, kw in ipairs(t.keywords) do table.insert(all_keywords, kw) end end djui_chat_message_create(table.concat(all_keywords, ", ")) return true end)