Psycho1 0 Posted March 29, 2002 Okay, I have a working script that will set a buildings damage back to 0 after it is blown up, but I want to have the building's damage set back to 0 after every hit it takes. Â I don't want the building to blow up, that's why I want to set the damage back to 0 right away. Â Here is what I tried to do: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">?!(local Server): Goto "end" _building = _this select 0 #start ~0 ?(_building dammage == 0):goto "start" _building setdammage 0 Goto "start" #end exit<span id='postcolor'> My problem is at: Â ?(_building dammage == 0):goto "start" dammage isn't the operator I'm looking for, and I tried setdammage as well. Â I looked around but can't find any operator for the damage that a vehicle/building has. Â If anyone knows what I need to put in there, plz let me know. I do realize buildings can get wiped out with 1 hit from tanks, but I still want the building to keep from blowing up for as long as possible. By the way, that script is Karrillion's creation, I just modifed it a bit. Share this post Link to post Share on other sites
Chris Death 0 Posted March 29, 2002 I think this is what you need; getDammage obj Operand types: obj: Object Type of returned value: Number Description: Object dammage in range 0 to 1 Example: getDammage player note: taken from the official comre Share this post Link to post Share on other sites
Psycho1 0 Posted March 29, 2002 Thx, I got it figured out once I knew how to get the damage of the building. Here is the working script: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">?!(local Server): Goto "end" _building = _this select 0 #start ~0 _damage= getDammage _building ?(_damage == 0):goto "start" _building setdammage 0 Goto "start" #end exit<span id='postcolor'> Share this post Link to post Share on other sites
RED 0 Posted March 29, 2002 Just woundering is that my script ? I made one like that ages ago. RED Share this post Link to post Share on other sites
Psycho1 0 Posted March 30, 2002 I got it from Karrillion, he posted it here a few weeks ago. Share this post Link to post Share on other sites
Psycho1 0 Posted March 30, 2002 I'm running into a problem if the building is blown up after only 1 hit. I was sort of expecting it, and I've modified the script to try and fix it. I was almost positive it would work, but the destroyed building would still just sit there:( The reason their is a problem is because I have no delay before it sets the damage back to 0. That works unless for example an M1A1 hits the building with sabot. It goes down immediately, and with no delay, it can't set the damage back because it's still in it's blowing up routine I think. It would work if I have a delay of 20 seconds if the building blows up, so here is what I did: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">?!(local Server): Goto "end" _building = _this select 0 #start ~0 _damage= getDammage _building ?(_damage == 0):goto "start" ?(damage == 1):goto "destroyed" _building setdammage 0 Goto "start" #destroyed ~20 _building setdammage 0 Goto "start" #end exit<span id='postcolor'> I was pretty sure it would work since I have the script jump to a section where the delay is 20 if the building is at a damage of 1, but it doesn't. Any help is greatly appreciated. Share this post Link to post Share on other sites
Psycho1 0 Posted March 30, 2002 LOL, I'm pretty sure I caught my error....I didn't notice it till right after I posted that last message. Â As you can tell, I don't have the _ before damage for the part that jumps to destroyed, so that could very well be the only problem I made. EDIT: Just went and checked it out. It works exactly the way I want it now, hate it when I mess things up with such a small error, hehe. Share this post Link to post Share on other sites