I manage to make my NPC playing lute/flute but there is no sound.
So I trying to using OnAnimationEvent to play the Lute music when ever IdleLuteStart is trigger.
But the OnAnimationEvent is never triggered. I know that I have to use RegisterForAnimationEvent and I already put that line into OnLoad event.
But it doesn't work.I have no idea what I did wrong.
This is my code, i didn't put lines to play the lute music because i want to make sure first that the event is work.
Scriptname testCustomChar01Lute extends ObjectReference{TestLute}EVENT onLoad()Debug.Trace("This object is loaded, playing animations should work now")Debug.MessageBox("aadasdasd")If (!RegisterForAnimationEvent(self, "idleLuteStart")) Debug.Trace("Failed to register for event!") // never show up in log file, i assume that register event is fine.EndIfendEVENTEvent OnAnimationEvent(ObjectReference akSource, string asEventName)Debug.Trace("Event Fired!!") // never show up in log fileDebug.MessageBox(asEventName ) // same hereendEventI put this script in my NPC's Actor script.
PS. Onload event isn't work when I first loaded into the game, I have to use commands "Disable" and "Enable" to trigger Onload event.

.