Jump to content

G.E.C.K. simple script help


zirome

Recommended Posts

I'm guessing you need to delete the else statement. That's causing the lights turn turn off should you activate the door with the lights on. So:

 

ScriptName LightSwitchScript

ref light

Begin OnActivate
if light == 0
set light to GetLinkedRef
endif

if light.GetDisabled
light.Enable
endif
Activate
End

Link to comment
Share on other sites

If the code only needs to be run once, then you could condense the script even further by using your "light" variable in the same manner as a "doOnce" variable:

ScriptName LightSwitchScript

ref light

Begin OnActivate

if light
else; if light == 0
	set light to GetLinkedRef
	light.Enable
endif

End

Cipscis

Link to comment
Share on other sites

  • Recently Browsing   0 members

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