Jump to content

[LE] Night-time event condition?


luvadea

Recommended Posts

You can put the script directly on the flyingdutchman and try something like this:

 

GlobalVariable Property GameHour Auto 

Event OnInit() 
    UpdateVisible() 
EndEvent
    
Event OnUpdateGameTime()
     UpdateVisible() 
 EndEvent 

Function UpdateVisible() 
    Utility.Wait(1)
    Float Hour = GameHour.GetValue()
    If Hour > 6 && Hour <= 23 
        Self.Disable() 
    Else 
        Self.Enable()
    Endif 
    
    Float nextUpdate
    
    If Hour > 6 && Hour <= 23
       nextUpdate = (23.0 - Hour)
    Elseif Hour >= 23 && Hour < 24
       nextUpdate = 6.0 + (24.0 - hour)
    Else 
       nextUpdate = (6.0 - Hour)
    Endif
   
    RegisterForSingleUpdateGameTime(nextUpdate)
EndFunction
Link to comment
Share on other sites

  • Recently Browsing   0 members

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