Jump to content
Sign in to follow this  
mr.g-c

Make a Building on the Map "undestroyable" ?

Recommended Posts

Hi i have a building on my map which gets destroyed very often by enemy choppers crashing in it...

Is there a way to make a certain building on the map "undestroyable" via a short script or something like that?

I have the ID of the Object in the Editor....

Best Regards, Christian

Share this post


Link to post
Share on other sites

I haven't tested it put perhaps something like this:

1) Create a game logic within 50m of the building. Give it a name (for this example GameLogic). This will allow us to "find" the building with the nearestObject command as seen below

2) Create a trigger with the params Nobody, none, and repeatedly.

3) In the trigger condition put (use your object ID instead of 123456):

getDammage (position GameLogic nearestObject 123456) > 0;

This constantly checks the damage of the building and activates the trigger whenever it is damaged.

4) In the On Act. of the trigger put (again use your Object ID):

(position GameLogic nearestObject 123456) setDammage 0;

This should repair the building to 0 damage and deactivate the trigger.

Good luck!

Share this post


Link to post
Share on other sites

WORKS!

Great! Thank you very much!

Regards, Christian

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×