Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  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. InUse = 1
  13. Self.BlockActivation(true)
  14. MusicREF.Add()
  15. RegisterForSingleUpdate(Duration)
  16. endif
  17. EndEvent
  18.  
  19. Event OnUpdate()
  20. InUse = 0
  21. Self.BlockActivation(false)
  22. MusicREF.Remove() ; Cleanup music just in case
  23. EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement