James Grimm 0 Posted January 6, 2018 What I want to do is add an action that updates for a sign every sec to display how long time is left for the cooldown. In the while loop, i want the %1 to be _1. _tele = _this select 0; _caller = _this select 1; _sign = TestSign; _Cash = score _caller; _i = 5; hint format["you have %1 in cash",_Cash]; while {_i>0} do { removeAllActions _sign; _sign addAction ["Cooldown %1",""]; sleep 1; _i = _i-1; }else { removeAllActions _sign; _sign addAction ["Buy scope WIP","PengarFraga.sqf"]; }; Share this post Link to post Share on other sites
Schatten 284 Posted January 7, 2018 @James Grimm, use format command. Also you can change title of existing action using setUserActionText command, but you need to know its ID. Share this post Link to post Share on other sites
James Grimm 0 Posted January 7, 2018 I don't understand where in this command(TestSign addAction ["Cooldown %1",""];) to I put the format [Cooldown %1, _i]; @Schatten Share this post Link to post Share on other sites
James Grimm 0 Posted January 7, 2018 I've got closer it needs to be like this I think TestSign addAction format["Cooldown %1",]; but I don't know where to put the variable for _i Share this post Link to post Share on other sites
Schatten 284 Posted January 7, 2018 @James Grimm, _sign addAction [format ["Cooldown %1", _i], ""]; Share this post Link to post Share on other sites
Schatten 284 Posted January 7, 2018 @James Grimm, #define START_TIME 5 _formatString = "Cooldown %1"; _id = _sign addAction [format [_formatString, START_TIME], ""]; for "_i" from (START_TIME - 1) to 1 step -1 do { sleep 1; _sign setUserActionText [_id, format [_formatString, _i]]; }; _sign removeAction _id; _sign addAction ["Buy scope WIP", "PengarFraga.sqf"]; Share this post Link to post Share on other sites
James Grimm 0 Posted January 7, 2018 Thank you it works now. as you can tell I'm new to this. So thank you for your patience. Share this post Link to post Share on other sites