Difference between revisions of "Talk:Enable - ObjectReference"

84 bytes removed ,  01:19, 3 December 2012
imported>HawkFest
imported>HawkFest
Line 49: Line 49:
Scriptname SimpleLightBulbSwitchScript extends ObjectReference  
Scriptname SimpleLightBulbSwitchScript extends ObjectReference  
ObjectReference Property LightBulbRef Auto
ObjectReference Property LightBulbRef Auto
Bool UseLightBulbRef = true


Event OnHit(ObjectReference Aggressor, Form Source, Projectile AkProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
Event OnHit(ObjectReference Aggressor, Form Source, Projectile AkProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
If Aggressor == Game.GetPlayer()
If Aggressor == Game.GetPlayer()
If UseLightBulbRef && LightBulbRef.IsDisabled() ;enabling an already enabled light disables it
If LightBulbRef.IsDisabled() ;enabling an already enabled light disables it
LightBulbRef.Enable()
LightBulbRef.Enable()
Else
Else
LightBulbRef.Disable()
LightBulbRef.Disable()
EndIf
EndIf
UseLightBulbRef = !UseLightBulbRef
EndIf
EndIf
EndEvent
EndEvent
Anonymous user