dragonslayer2k12 Posted November 21, 2013 Posted November 21, 2013 I need a script that plays a sound only when a certain armor is equipped and then stop playing the sound when that armor is no longer equipped. The script should be able to run on anyone npc or player. I was using one of the default audio scripts in the CK but since my sound to be played is a looped sound, there is no instructions in those default audio scripts to stop playing the sound so it just plays forever. Please post here if you can help thanks:-)
Xander9009 Posted November 23, 2013 Posted November 23, 2013 int instanceID = myLoopingSFX.play(self) ; play myLoopingSFX sound from my self Wait(10.0) ; wait while the sound is looping Sound.StopInstance(instanceID) That's directly from the Creation Kit website so it should work fine. Just stick it in a script on the amor, put it in an OnEquip event. Delete the wait line (you're not waiting an amount of time, but rather until another event. Move the last line to an OnUnequip event. Should be done. (and of course declare your variables; aka, properties)
meh321 Posted November 23, 2013 Posted November 23, 2013 Might have a problem with this when saving / loading game. You may need to use a quest alias to do this if it's the player only who is wearing the equipment and use OnPlayerLoadGame event, but I'm not sure I haven't tested playing sound through save games maybe it will work.
Recommended Posts