Advertisement
Guest User

Musicbox Script

a guest
Jan 22nd, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Scriptname aa_yourscriptname extends ObjectReference  
  2. {Change scriptname if u want.}
  3.  
  4. Actor Property PlayerREF Auto
  5. Musictype Property MusicREF Auto ; Set the musictype property, musictype MUST have the "Play One Selection" flag set.
  6. int InUse
  7. int Property Duration Auto ; Set this in properties as length of your song.
  8.  
  9. Event OnActivate(ObjectReference akActionRef)
  10.     if (akActionRef == PlayerREF)
  11.         if (InUse == 0) ; Check if Musicbox is playing
  12.         MusicREF.Add()
  13.         RegisterForSingleUpdate(Duration)
  14.     endif
  15. EndEvent
  16.  
  17. Event OnUpdate()
  18.     InUse = 1
  19.     MusicREF.Remove() ; Cleanup music just in case
  20. EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement