Jump to content
Sign in to follow this  
zuff

Making a Vehicle Cardboard Target (Lockable) respawn?

Recommended Posts

I'm setting up a target range for new players to practice on. I've included various vehicles, a refilling ammo crate, target range, pop-up targets etc.

What I'm trying to do is setup the Vehicle Cardboard targets to respawn after destroyed. I tried using Tophe's resupply script but it doesn't seem to work. Anyone have any ideas?

Also, suggestions for adding more stuff to the practice range would be appreciated too! I'll link the mission file when I'm done for others to use.

Share this post


Link to post
Share on other sites

place this in any units initline:

this addEventHandler ["killed", {_this execVM "targetRespawn.sqf"}];

save this below as targetRespawn.sqf and place in mission folder.

_old = _this select 0;
_pos = getPos _old;
_dir = getDir _old;
_typ = typeOf _old;
sleep 5;  // set the time until respawn here, default is set to 5 seconds.

if (isServer) then {
deleteVehicle _old;
_trg = createVehicle [_typ, _pos, [], 0, "NONE"];
_trg setDir _dir;
_trg setPos _pos;
_trg addEventHandler ["killed", {_this execVM "targetRespawn.sqf"}];
};

Share this post


Link to post
Share on other sites

Excellent! Thank you very much.

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  

×