
Leaving in old script, for anyone else who may be learning:
Spoiler
Scriptname _WellScript extends ObjectReference
;timecheck
GlobalVariable property GameHour auto
float Property NoEarlierThan = 22.0 Auto
float Property NoLaterThan = 4.0 Auto
bool function IsTimeValid()
Float Time = GameHour.GetValue()
if NoEarlierThan == 22 && NoLaterThan == 4
return TRUE
endif
if NoEarlierThan > NoLaterThan
if Time >= NoEarlierThan && Time <= NoLaterThan
return TRUE
endif
elseif NoEarlierThan < NoLaterThan
if Time >= NoEarlierThan || Time <= NoLaterThan
return TRUE
endif
endif
Return FALSE
endFunction
;door
Event OnActivate(ObjectReference akAcrionRef)
if IsTimeValid() == TRUE
;no action, door will function
else
BlockActivation(TRUE)
Debug.MessageBox("I can't enter the well in broad daylight!")
endif
endEvent
Scriptname _WellScript extends ObjectReference
;timecheck
GlobalVariable property GameHour auto
float Property NoEarlierThan = 22.0 Auto
float Property NoLaterThan = 4.0 Auto
bool function IsTimeValid()
Float Time = GameHour.GetValue()
if NoEarlierThan == 22 && NoLaterThan == 4
return TRUE
endif
if NoEarlierThan > NoLaterThan
if Time >= NoEarlierThan && Time <= NoLaterThan
return TRUE
endif
elseif NoEarlierThan < NoLaterThan
if Time >= NoEarlierThan || Time <= NoLaterThan
return TRUE
endif
endif
Return FALSE
endFunction
;door
Event OnActivate(ObjectReference akAcrionRef)
if IsTimeValid() == TRUE
;no action, door will function
else
BlockActivation(TRUE)
Debug.MessageBox("I can't enter the well in broad daylight!")
endif
endEvent

