maxarturo Posted January 28, 2019 Share Posted January 28, 2019 (edited) Hi everyone !.I've encountered a small issue in which i can't make an activator to return the key (Skyrim).I'm using the sarcophagus lock and a skull key, the script is working just fine but i can't remove the skull key, I try all weekend to make it work but... for the love of god... what am i missing ? is the first activator i've encounter this issue, everything else i've scripted works fine. My script without the remove function (works as intended): Scriptname aXMDSkullLockSCRIPT01 extends ObjectReference {Script for the Skull Lock setup} Quest Property myQuest auto {The quest we will be setting stages on} Int Property stageSetOnTriggered auto {The stage that will be set when the player Triggered this slot, or activates the slot without the required item} ObjectReference Property SecretDoor auto {Activates door or activator} MiscObject Property myKey01 auto ObjectReference Property BarrierSound auto {Disable link Ref} Message Property emptySlotMessage auto {Message that shows when the player Triggers this slot without the required keys.} bool Property isTriggered = false auto hidden Event onActivate(ObjectReference akActionRef) if (isTriggered != TRUE && akactionref.getitemcount(myKey01) >= 1) if (myQuest.GetStageDone(stageSetOnTriggered) == FALSE) myQuest.SetStage(stageSetOnTriggered) endif akactionref.removeitem(myKey01, 1) ;debug.messagebox("Removing KEY 01 From PLAYERS INVENTORY") PlayAnimationAndWait("Insert", "Done") isTriggered = true SecretDoor.activate(self) BarrierSound.disable() else if (isTriggered != TRUE && akactionref.getitemcount(myKey01) >= 0) emptySlotMessage.Show() endif endif endEvent This is my script with the remove key function (NOT WORKING): Scriptname aXMDSkullLockSCRIPT01 extends ObjectReference {Script for the Skull Lock setup} Quest Property myQuest auto {The quest we will be setting stages on} Int Property stageSetOnTriggered auto {The stage that will be set when the player Triggered this slot, or activates the slot without the required item} ObjectReference Property SecretDoor auto {Activates door or activator} MiscObject Property myKey01 auto ObjectReference Property BarrierSound auto {Disable link Ref} Message Property emptySlotMessage auto {Message that shows when the player Triggers this slot without the required keys.} bool Property isTriggered = false auto hidden Event onActivate(ObjectReference akActionRef) if (isTriggered != TRUE && akactionref.getitemcount(myKey01) >= 1) if (myQuest.GetStageDone(stageSetOnTriggered) == FALSE) myQuest.SetStage(stageSetOnTriggered) endif akactionref.removeitem(myKey01, 1) ;debug.messagebox("Removing KEY 01 From PLAYERS INVENTORY") PlayAnimationAndWait("Insert", "Done") isTriggered = true SecretDoor.activate(self) BarrierSound.disable() else if (isTriggered != TRUE && akactionref.getitemcount(myKey01) >= 0) emptySlotMessage.Show() endif endif endEvent STATE ReadyToTake Event onActivate(ObjectReference akActionRef) if (isTriggered != FALSE && akactionref.getitemcount(myKey01) >= 0) PlayAnimationAndWait("Remove", "Done") isTriggered = false akactionref.Additem(myKey01, 1) ;debug.messagebox("Adding KEY 01 To PLAYERS INVENTORY") GoToState("AllDone") endif EndEVENT EndSTATE Thanks a lot to anyone who takes a look at this !!. * i just realized i made this post in the wrong section. Sorry.. DON'T READ THIS POST ! It was the first one i did but in the wrong section of Nexus and afterwards it was moved here.My original post has already been answer here:https://forums.nexusmods.com/index.php?/topic/7351716-can-somebody-help-with-a-little-script/ Edited January 29, 2019 by maxarturo Link to comment Share on other sites More sharing options...
Recommended Posts