L.Trale 10 Posted October 7, 2013 I'm trying to make a script when the player gets down if their health is low enough if (damage player > 0.8) then {hint "Worked";}; At the moment, I'm just trying to make it hint that it works. For some reason, it doesn't. Any help? Thanks. Share this post Link to post Share on other sites
HazJ 1288 Posted October 7, 2013 (edited) if ((damage player) > 0.8) then {hint "Worked";}; Dirty Haz Edit/Update: If you are using it in a script then try it like this: // nul = [this] execVM "scriptname.sqf"; _unit = _this select 0; if ((damage _unit) > 0.8) then {hint "Worked";}; Dirty Haz Edited October 7, 2013 by Dirty Haz Edit/Update Share this post Link to post Share on other sites
L.Trale 10 Posted October 7, 2013 Thanks for the reply, but it's not working. Share this post Link to post Share on other sites
HazJ 1288 Posted October 7, 2013 It works for me, if you send me your mission then I can take a look for you. :) Dirty Haz Share this post Link to post Share on other sites
L.Trale 10 Posted October 7, 2013 Alright, thanks. I'll put a download link in a second. ---------- Post added at 20:11 ---------- Previous post was at 20:06 ---------- http://www.mediafire.com/?854sfvq7434ss2k Download link to the Example Mission. Thanks for the help :) Share this post Link to post Share on other sites
HazJ 1288 Posted October 7, 2013 It works but it causes my game to freeze, etc (only in A3) which is very strange... Try this way instead: _unit = _this select 0; waitUntil {(damage _unit) > 0.8}; hint "Worked"; Dirty Haz Share this post Link to post Share on other sites
L.Trale 10 Posted October 7, 2013 Works. Really appreciate you helping me out, thanks :) Share this post Link to post Share on other sites
HazJ 1288 Posted October 7, 2013 No problem, always happy to help! :) Dirty Haz Share this post Link to post Share on other sites
L.Trale 10 Posted October 7, 2013 How would I give the player who is not down the action to revive the player down? Here is the script so far: _unit = _this select 0; waitUntil {(damage _unit) > 0.8}; playsound "Down"; _unit allowdamage false; _unit switchmove "AinjPpneMstpSnonWnonDnon_injuredHealed"; hint "Someone is down, you have 30 seconds to revive them!"; sleep 10; hint "Someone is down, you have 20 seconds to revive them!"; sleep 10; hint "Someone is down, you have 10 seconds to revive them!"; sleep 5; hint "Someone is down, you have 5 seconds to revive them!"; sleep 1; hint "Someone is down, you have 4 seconds to revive them!"; sleep 1; hint "Someone is down, you have 3 seconds to revive them!"; sleep 1; hint "Someone is down, you have 2 seconds to revive them!"; sleep 1; hint "Someone is down, you have 1 second to revive them!"; sleep 1; _unit setdamage 1; Share this post Link to post Share on other sites
Lucasmnunesk 2 Posted October 7, 2013 The best idea i had was this waitUntil {(damage _unit) > 0.8}; and you need something to check this before adding the action if ( (damage _unit) > 0.8 ) then { _unit addAction ( http://community.bistudio.com/wiki/addAction ) use the syntax here } and this action would remove itself after running everything it needs to keep the player up and good Hope i could help but i'm not really good at scripting still a early learner and i have stopped playing with scripts for a while Share this post Link to post Share on other sites
L.Trale 10 Posted October 7, 2013 Thanks, but It gives the played who is downed the action to revive. ---------- Post added at 21:27 ---------- Previous post was at 21:10 ---------- Also, anyone know how to stop a script? When the player gets down, they are given the action. Then, when you use the action, the first script (Down) should stop so it doesn't execute the final command (_unit setdamage 1; ) ---------- Post added at 22:00 ---------- Previous post was at 21:27 ---------- scriptName = [parameters] execVM "yourname.sqf"; Terminate scriptName; Doesn't work. Help? Share this post Link to post Share on other sites