Jump to content
CyDoNgr

Re-spawn custom object

Recommended Posts

I have placed on the map a building from the props section. Is there any way to re-spawn it at it's position and destroy the wreck if its destroyed, like with vehicles?

Thx!

Share this post


Link to post
Share on other sites

Of course it is.

lol help him man :P

Share this post


Link to post
Share on other sites

You put this in init field of object

null = [this] execVM "object.sqf";

object.sqf

params ["_object"];

_pos = getPos _object;
_dir = getDir _object;
_class = typeOf _object;

while { true } do 
{
    deleteVehicle _object;
    _object = createVehicle [_class, _pos, [], 0, "NONE"];
    _object setDir _dir;
    waitUntil { sleep 1; !alive _object };
    sleep 60;
};

I did not include object orientation in 3D dimension (yawn, pitch, ...).

 

I am using this technique for my vehicles to respawn.

  • Like 2

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

×