
Maybe Im doing it wrong and missing what I got..but it seems to always report 'playing' even if its not. Playlist says: Now Playing Nothing, currently. But with this it always returns 'true' and 'playing' PlaySound('Roll 20 Crit Hit', 9000);
function PlaySound(trackname, time) {
var track = findObjs({type: 'jukeboxtrack', title: trackname})[0];
log(track);
if(track && track.get('playing') === true) {
log('Already playing');
track.set('playing', false);
} else if(track) {
log("playing");
track.set('playing', true);
setTimeout(function() {track.set('playing', false);}, time);
} else {
log('ERROR');
}
}
This is the debug return: {"_type":"jukeboxtrack","_id":"-K-0B6l3ZTdJWd4o7LCV","playing":true,"softstop":true,"title":"Roll 20 Crit Hit","loop":false,"volume":100}
"Already playing"
Any ideas? I cannot get sounds to play at all. it seemed to be working over the weekend, but now nothing.