RowanSkie Posted November 16, 2019 Author Share Posted November 16, 2019 (edited) I managed to merge the three codes we made! Now, since I managed to pinpoint which potions need this thing, I'm up to adding it. At least it's a few. Here's the whole thing. I think I didn't do well. Scriptname rep_keyObject Extends ObjectReference Group Properties MiscObject Property rep_tinkey Auto Const Mandatory Keyword Property rep_canration Auto Const Mandatory Message Property rep_tinkeyuse Auto Const Mandatory EndGroup Event OnEquipped(Actor AkActor) if AkActor.GetItemCount(rep_tinkey) > 0 rep_tinkeyuse.Show() AkActor.RemoveItem(rep_tinkey) Debug.Trace("C-Ration opened with key.") Elseif AkActor.GetItemCount(rep_tinkey) == 0 AkActor.DamageValue(Game.GetHealthAV(), 10) Debug.Trace("C-Ration opened without key.") endif EndEvent Random assignment of Actor, ;-; EDIT: And it turns out Potions don't get Scripts. *facepalm* Edited November 16, 2019 by RowanSkie Link to comment Share on other sites More sharing options...
scrivener07 Posted November 16, 2019 Share Posted November 16, 2019 I think you did well. Maybe check that the actor is the player and not some random NPC. Scriptname rep_keyObject Extends ObjectReference {Attach this to each of your potions.} Group Properties MiscObject Property rep_tinkey Auto Const Mandatory Keyword Property rep_canration Auto Const Mandatory Message Property rep_tinkeyuse Auto Const Mandatory EndGroup Event OnEquipped(Actor AkActor) If (akActor == Game.GetPlayer()) ; you dont want an NPC to trigger a message in the players face if AkActor.GetItemCount(rep_tinkey) > 0 rep_tinkeyuse.Show() AkActor.RemoveItem(rep_tinkey) Debug.Trace("C-Ration opened with key.") Elseif AkActor.GetItemCount(rep_tinkey) == 0 AkActor.DamageValue(Game.GetHealthAV(), 10) Debug.Trace("C-Ration opened without key.") endif EndIf EndEvent Attach to your potions and I think your good to go. Link to comment Share on other sites More sharing options...
scrivener07 Posted November 16, 2019 Share Posted November 16, 2019 Damn your right. Well that was a massive undersight on my part! Link to comment Share on other sites More sharing options...
scrivener07 Posted November 16, 2019 Share Posted November 16, 2019 Heh, well back to the remote method of things then?Sorry for the double post. Ive been acquainted with discord. Link to comment Share on other sites More sharing options...
RowanSkie Posted November 16, 2019 Author Share Posted November 16, 2019 Heh, well back to the remote method of things then?Sorry for the double post. Ive been acquainted with discord.Considering we're literally in the same discords (AAF and DTF), yup! Link to comment Share on other sites More sharing options...
Recommended Posts