Raccoonmancer Posted March 8, 2022 Posted March 8, 2022 Pretty much what the title says. To detail my use case a bit more in steps; 1. I've created a custom weapon.2. When entering specific areas or entering a 'trigger box', it would play a sound file, in this case someone speaking to you, without there being an actual NPC (Imagine Meridia's Beacon when you pick up the item for the first time). The requirement for the sound file to play, would be that you must have the weapon either in your inventory or your hand. My main question is if someone could provide me a general idea or tutorial that I could look at to try and do something like this. Thank you for any and all answers :)
dylbill Posted March 9, 2022 Posted March 9, 2022 You can put a script on a triggerbox with conditions. Something like this: Scriptname TM_ObjectReferenceScript extends ObjectReference Weapon Property MyWeapon Auto Sound Property MySound Auto Actor Property PlayerRef Auto Event OnTriggerEnter(ObjectReference akActionRef) If akActionRef == PlayerRef ;did the player enter this trigger box? If PlayerRef.GetItemCount(MyWeapon) > 0 ;does the player have at least one of MyWeapon in inventory MySound.Play(PlayerRef) ;Play MySound from PlayerRef Endif endif EndEventIf you're new to scripting, I recommend doing a beginner scripting tutorial. There's a lot of em out there.
Recommended Posts