Thicketford Posted December 3, 2016 Share Posted December 3, 2016 I've added shutters to the windows at Star Light drive in. The shutters are tied to an initially disabled x marker ("shuttermarker") and I'm trying to add a script to a button that will toggle them on/off. Here's the script... Scriptname StarlightShutters extends ObjectReferenceObjectReference Property ShutterMarker AutoEvent OnActivate(ObjectReference akActionRef) if (ShutterMarker.IsDisabled()) ShutterMarker.Enable() elseif ShutterMarker.Disable() endifEndEvent I keep getting the error "cannot cast a void to a bool to perform a condition check" when I try to save it. Can anyone help? Link to comment Share on other sites More sharing options...
LoneRaptor Posted December 3, 2016 Share Posted December 3, 2016 (edited) Write it like this: Event OnActivate(ObjectReference akActionRef) If(ShutterMarker.IsDisabled()) ShutterMarker.Enable() Else ShutterMarker.Disable() EndIf EndEvent Edited December 3, 2016 by LoneRaptor Link to comment Share on other sites More sharing options...
Thicketford Posted December 3, 2016 Author Share Posted December 3, 2016 The script works now. Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts