Jump to content
Goro

All OPFOR soldiers die with HS only

Recommended Posts

Hello there.

I'm trying to make a script that will make all OPFOR soldiers to die with only headshot.

The script needs to be instantly checked, because the soldiers spawn during the mission.

 

Thanks in advance!

Share this post


Link to post
Share on other sites

Can't get the script working, anyone?

 

while {alive player} do {
if (_x side == "EAST") then {_x addEventHandler ["HandleDamage", {if (_this select 1 in ["head_hit"]) then {_this select 2}}]};
sleep 0.1;
};

Share this post


Link to post
Share on other sites

On my phone, so this is pseudo, but when the event handler executes:

if !(isPartHead) then
{
     0;
} else
{
    1; (or return damage dealt)
};
Also, why the loop? The EH, once applied doesn't need to be applied again, also "_x" won't work unless you have it all wrapped in a forEach loop.

Share this post


Link to post
Share on other sites

Well, the soldiers will spawn later, so I think I needed to loop that.

Share this post


Link to post
Share on other sites

Now I've got something like this:

while {alive player} do {{ _x addEventHandler ["HandleDamage", {if !(isPartHead) then
{
     0;
} else
{
    1;
};} } forEach units east;
sleep 0.1;};
 
Still, doesn't work.

Share this post


Link to post
Share on other sites

Like I said, my code was psuedo (meaning it's the concept not actual code), isPartHead isn't a command, and if you loop through all east units every tenth of a second your loop will be extrnemly heavy and every alive east unit will have a lot of handleDamage EHs. I can't provide proper code atm from my phone, so hopefully someone else can assist in this matter.

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

×