Jump to content

Making a container reset inventory every 24 hours?


StarTrekManiac2

Recommended Posts

Hi guys,

 

With the Creation Kit for Skyrim, I want to have respawning items that I can collect from the same place every day.
I'm trying to make three containers that I've placed to automatically populate with the same inventory, as it had initially, every 24 hours, as opposed to waiting for the cell to reset.
I currently have the following script written up with the aid of other sources, but it won't compile. I'm very new to scripting and have tried to research with no luck on getting the script to work.
ScriptName aaRespawn extends ObjectReference




Event OnInit()
         RegisterForUpdateGameTime(20)
EndEvent


Event OnUpdateGameTime()
self.Reset()
EndEvent
Can anyone suggest areas that are causing the problem or possibly write a new script to do this?
Link to comment
Share on other sites

I just tried to compile your script as-is and it worked. No idea why it would not compile for you. Now I did not test to see if it functioned as intended but the compilation went through.

 

It is very strange. I tried again from scratch with the same script and still wouldn't compile.

 

However I came up with this and it works like magic for me now :)

 

ScriptName aaRespawn extends ObjectReference


Event OnClose(ObjectReference akActionRef)
          RegisterForUpdateGameTime(20)
EndEvent


Event OnUpdateGameTime()
          Reset()
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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