Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname aa_yourscriptname extends ObjectReference
- {Change scriptname if u want.}
- Actor Property PlayerREF Auto
- Musictype Property MusicREF Auto ; Set the musictype property, musictype MUST have the "Play One Selection" flag set.
- int InUse
- int Property Duration Auto ; Set this in properties as length of your song.
- Event OnActivate(ObjectReference akActionRef)
- if (akActionRef == PlayerREF)
- if (InUse == 0) ; Check if Musicbox is playing
- InUse = 1
- Self.BlockActivation(true)
- MusicREF.Add()
- RegisterForSingleUpdate(Duration)
- endif
- EndEvent
- Event OnUpdate()
- InUse = 0
- Self.BlockActivation(false)
- MusicREF.Remove() ; Cleanup music just in case
- EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement