
Ive tried everything I can think of..and it logs correctly. but I nor anyone else can hear the sound playing. here is the code Im testing with: on("ready", function() {
PlaySound('Headshot', 9000)
});
function PlaySound(trackname, time) {
var track = findObjs({type: 'jukeboxtrack', title: trackname})[0];
track.set('playing',false);
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");
}
} and the debug I get {"_type":"jukeboxtrack","_id":"-K-0CQvOha0HA0uWI8YO","playing":false,"softstop":true,"title":"Headshot","loop":false,"volume":100}
"playing"
{"_type":"jukeboxtrack","_id":"-K-0CQvOha0HA0uWI8YO","playing":true,"softstop":true,"title":"Headshot","loop":false,"volume":100}
"stopping sound"
Which is all correct. Its logging the song as not playing. logs starting it, logs it as playing..then 9 seconds later stopping it. Whats really weird if I play it from the jukebox manually, SOMETIMES a save will play it once after that, but not again, and not all the time. I cant figure it out. Any tips?