Skip to content

Instantly share code, notes, and snippets.

@cozza13
Created December 16, 2016 01:15
Show Gist options
  • Save cozza13/5f083ae1250c7de500a6b319e4769435 to your computer and use it in GitHub Desktop.
Save cozza13/5f083ae1250c7de500a6b319e4769435 to your computer and use it in GitHub Desktop.
(function() {
var _this = this;
var sound = SoundCache.getSound("https://s3.amazonaws.com/converter.tipodean.com/sounds/Brahms_Sym1-mono.wav");
// this is the version of injector that is visible to your leaveEntity() method
var injector;
_this.enterEntity = function(entityID) {
print('I am insiude');
injector = Audio.playSound(sound, { loop: true, volume: 1.0 });
injector.restart();
};
_this.leaveEntity = function(entityID) {
print('I am outsidee');
injector.stop();
print("Reverb is OFF.");
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment