
Hello everybody, I have problems with triggering sound effects by roll results or chat messages if the trigger itself is inside an inline roll or an inline expression of a rollable table. Here is a simple script that I tried to get to work on("ready", function() { on("chat:message", function (msg) { if (msg.type === "api" && msg.content === "!crit") { PlaySound('crit', 4000); }; if (msg.type === "emote" && msg.content.match(/critical/i)) { PlaySound('crit', 4000); }; if (msg.type === "rollresult" && msg.content.match(/v\":10/)) { PlaySound('crit', 4000); }; if (msg.type === "general" && msg.content.match(/"v":10}/)) { PlaySound('crit', 4000); }; if (msg.type === "rollresult" && msg.content.match(/v\":1/)) { PlaySound('fumble', 4000); }; if (msg.type === "general" && msg.content.match(/"v":1}/)) { PlaySound('fumble', 4000); }; if (msg.type === "api" && msg.content === "!dead") { PlaySound('dead', 3000); }; }); }); function PlaySound(trackname, time) { var track = findObjs({type: 'jukeboxtrack', title: trackname})[0]; track.set('playing',false); track.set('softstop',false); track.set('volume', 100); log(track); if(track) { track.set('playing',true); log('playing'); setTimeout(function() {track.set('playing',false);log('stopping sound');}, time); log(track); } else { log("No track found"); } } It is working fine for roll results coming out of commands like /roll 1d10 but not for inline rolls like [[1d10]] Further /em makes a critical hit is working fine too but /em [[1t[crittable]]] doesn't trigger the sound if the table roll result contains the word critical. I'm pretty sure the solution lies somewhere here , but as I can hardly manage to adjust existing scripts to my individual needs and sadly have basically NO skills in scripting myself I wasn't able to put those two together :( If the answer is more complicated than a few lines, never mind: It is just not THAT important. But if there maybe is a simple solution I would be very happy about some help with this problem. Thank you very much in advance!