Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;< Music Control
- ; Set musicID to a valid ID to stop the last music and start the new music - set it to -1 to stop the music.
- (global short musicID -1)
- (global short ~cachedMusicID -1)
- (global looping_sound ~musicLoopingSound levels\b40\music\b40_03)
- (script static looping_sound MusicIDToLoopingSound ;; Why can't I just return the value by itself? hsc plz
- (cond
- ((= 0 ~cachedMusicID)
- (set ~musicLoopingSound levels\b40\music\b40_07)
- )
- ((= 1 ~cachedMusicID)
- (set ~musicLoopingSound levels\b40\music\b40_03)
- )
- ((= 2 ~cachedMusicID)
- (set ~musicLoopingSound levels\b40\music\b40_06)
- )
- )
- ~musicLoopingSound
- )
- (script continuous ~ChangeMusic
- (sleep_until (!= musicID ~cachedMusicID))
- (sound_looping_stop (MusicIDToLoopingSound))
- (set ~cachedMusicID musicID)
- (if (>= ~cachedMusicID 0)
- (begin
- (sound_looping_predict (MusicIDToLoopingSound))
- (sleep 30)
- (sound_looping_start (MusicIDToLoopingSound) none 1.0)
- )
- )
- )
- ;>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement