Jump to content
Sign in to follow this  
mantls

addAction on Razorwire

Recommended Posts

Hey there,

Im having problems using the addAction command on Razorwire. While it works farely fine on most objects i just cant manage to find it on razorwire.

And since i'm spawning it with a script i can't just give it a name, wich would make it pretty easy of course.

I'm pretty sure that this has something to do with its model, so if somebody has a workaround or solution that'd be awesome!

many thanks in advance!

Mantis

Share this post


Link to post
Share on other sites

it is tricky one, you have to point at the supports, not wire itself, before it registers in cursorTarget

Share this post


Link to post
Share on other sites

Create an SQF which checks if the player is within a certain distance to the razorwire (name the razorwire, or do a nearestObjects check).

If the player is within the required distance to the razorwire, then addaction to the player.

razorCheck.sqf

//Let's say that you named the razor wire "razorWire1"
private ["_action"];
waitUntil {player distance razorWire1 < 10};
_action = player addAction ["ACTION","SCRIPT.SQF"];
waitUntil {player distance razorWire1 > 10};
if(true) exitWith {player removeAction _action; execVM "razorCheck.sqf";};

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  

×