Povuholo Posted February 12, 2006 Share Posted February 12, 2006 Hi my mod is in the last stage: checking! And everything works fine, except one thing. When the player goes through a door to an other cell, a dead body is supposed to appear somewhere in another cell. But... if the player goes through the door multiple times, the body also appears on the spot multiple times! So what is the probably very simple line i need to add to my script to let it only happen once? Link to comment Share on other sites More sharing options...
Switch Posted February 12, 2006 Share Posted February 12, 2006 The typical thing is to do a doonce variable. So like: If ( deadbody == 1 ) Return EndIf Scriptey stuff Set deadbody to 1 Basically the script will stop running as soon as the condition is met. Link to comment Share on other sites More sharing options...
ThetaOrionis01 Posted February 12, 2006 Share Posted February 12, 2006 Switch is right about the DoOnce condition, but if you still want the player to be able to enter the cell after the first time, when the body has been placed, you'll have to take that into account. First, declare your new variable - eg short deadbody Then add an extra if/else/endif condition If ( OnActivate == 1 ) If ( deadbody == 0 ) [your code about placing the body etc] Set deadbody to 1 Else ActivateEndifEndif That should only place the body once while still allowing the player to enter the cell after the first time... Link to comment Share on other sites More sharing options...
Povuholo Posted February 12, 2006 Author Share Posted February 12, 2006 Thanks, it's working now. The mod is going to get released really soon :) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.