Jump to content

[LE] Can somebody help with a little script ?


maxarturo

Recommended Posts

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:
Edited by maxarturo
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...