Jump to content

[Script] RegisterforSleep() and OnSleepStart()


Recommended Posts

I'm a bit confused about this process

 

I want the player to receive a spell when they go to sleep.

 

But where would I put

Function SleepFunction()
RegisterForSleep() 
EndFunction

And the following Event? In the Magic Effect script?

 

 

Link to comment
Share on other sites

You can put that on any form. I'd recommend maybe putting it on a quest script. Example:

 

Spell Property MySpell Auto

Event OnQuestInit()
    RegisterForPlayerSleep() 
EndEvent

Event OnPlayerSleepStart(float afSleepStartTime, float afDesiredSleepEndTime, ObjectReference akBed)
    Game.GetPlayer().AddSpell(MySpell)
    UnRegisterForPlayerSleep()
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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