enderalse/source/scripts/_00e_fs_nqr05_playrandomsoundsc.psc

36 lines
1.0 KiB
Plaintext

Scriptname _00E_FS_NQR05_PlayRandomSoundSC extends ObjectReference
{Plays a designated sound in random intervals.}
;=====================================================================================
; EVENTS
;=====================================================================================
Event OnUpdate()
if PlayerREF.GetParentCell() == Self.GetParentCell()
soundToPlay.Play(PlayerREF)
RegisterForSingleUpdate(Utility.RandomInt(7, 15))
Else
UnregisterForUpdate()
EndIf
EndEvent
Event OnTriggerEnter(ObjectReference akActionRef)
RegisterForSingleUpdate(Utility.RandomInt(4, 11))
EndEvent
Event OnTriggerLeave(ObjectReference akActionRef)
UnregisterForUpdate()
EndEvent
;=====================================================================================
; PROPERTIES
;=====================================================================================
Actor Property PlayerREF Auto
Sound Property soundToPlay Auto