Cartie3 Posted March 20, 2013 Share Posted March 20, 2013 (edited) Hey, I'm just looking for some help with an attempted script I'm trying to make. I want to make a locked door open when I destroy a generator. I have linked the door to the generator and tried writing a script to make this happen but it always comes up with an error. If anyone can provide assistance I would be grateful. Edit: When I say generator, I mean one of the destructible electrical boxes. Edited March 20, 2013 by Cartie3 Link to comment Share on other sites More sharing options...
jazzisparis Posted March 20, 2013 Share Posted March 20, 2013 If the electrical box/generator has destruction data (look for 'Edit Destruction Data' in the object's record), then you can use OnDestructionStageChange to execute a command that will open the door once the electrical box is at the appropriate 'Damage Stage'. Something like: begin OnDestructionStageChange if GetDestructionStage == 3 YourDoorREF.SetOpenState 1 endif end Link to comment Share on other sites More sharing options...
nonplusultra Posted March 20, 2013 Share Posted March 20, 2013 (edited) scn yourscriptname ref linkeddoor short runonce begin GameMode set linkeddoor to getlinkedref if runonce == 0 if getdestroyed linkeddoor.unlock set runonce to 1 endif endif end p.s.: use this script in the e-box Edited March 20, 2013 by nonplusultra Link to comment Share on other sites More sharing options...
Cartie3 Posted March 20, 2013 Author Share Posted March 20, 2013 Thanks, this was a great help. Link to comment Share on other sites More sharing options...
Recommended Posts