Jump to content
Sign in to follow this  
UK_SPAWN

Help making script work for AI AND PLAYER

Recommended Posts

private ["_newDamage","_t"];

while {alive player} do

{

_t = time;

waitUntil {time - _t > 1};

if (damage player > 0) then

{

_newDamage = (damage player) - 0.25;

player setdamage _newDamage;

};

sleep 1;

};

waitUntil{alive player};

sleep 1;

Okay, i know it says PLAYER, but even if i change it to THIS, it still wont work for the AI. if i change it to the name of the AI in the editor... ill check tht now, but it still means ill need a separate script for each AI and 1 for PLAYERS.

Ideally i could do with it saying "ALL BLU FORCES" or "all USMC"..

ALSO: is it anything to do with the PRIVATE bit at the top?

Cheers guys n gals,

SPAWN

Share this post


Link to post
Share on other sites

Also, how do i combine;

if (Player distance _target >250) exitwith

WITH

[nil,T5,"loc",rHINT,"Missiles Available"] call RE;

Thanks

iv tried:

if (Player distance _target >250) exitwith {nil,T5,"loc",rHINT,"Missiles Available"} call RE;

and other variations but cant figure it out. Thanks

Share this post


Link to post
Share on other sites
private ["_newDamage","_t"];

while {alive player} do

{

_t = time;

waitUntil {time - _t > 1};

if (damage player > 0) then

{

_newDamage = (damage player) - 0.25;

player setdamage _newDamage;

};

sleep 1;

};

waitUntil{alive player};

sleep 1;

Okay, i know it says PLAYER, but even if i change it to THIS, it still wont work for the AI. if i change it to the name of the AI in the editor... ill check tht now, but it still means ill need a separate script for each AI and 1 for PLAYERS.

Ideally i could do with it saying "ALL BLU FORCES" or "all USMC"..

ALSO: is it anything to do with the PRIVATE bit at the top?

Cheers guys n gals,

SPAWN

What about PlayableUnits ? https://community.bistudio.com/wiki/playableUnits

if (Player distance _target >250) exitwith {nil,T5,"loc",rHINT,"Missiles Available"} call RE;

Did you tried Then intense exitwith ?

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  

×