Forxtop 10 Posted October 14, 2016 Hello! So for my scenario, i designed a little script to forbid players to left an area. To avoid desertion. 1/ There is a trigger (PRESENT / ANYBODY), repeatable, with condition. Its area is a rectangle (like a border, very large but not long 10m). player in thislist && isTouchingGround player Activation : nothing, Desactivation : null = [decl_DesertionPartie1] execvm "scripts\desertion.sqf"; 2/ The script : _declencheur = _this select 0; if (isNil "desertion") then {desertion = true}; if (desertion) then { TitleText ["VOUS DESERTEZ, VOUS AVEZ 10 SECONDES, REVENEZ EN ARRIERE", "PLAIN", 2]; _compteArebours = 10; _ValeurDegat = 0.01; While { !(player in list _declencheur) } do { sleep 1; _compteArebours = _compteArebours - 1; if (_compteArebours <= 0) then { player setDamage _ValeurDegat; _vie = 1 - (getDammage player); hint format ["VOTRE VIE RESTANTE : %1 REVENEZ EN ARRIERE!",_vie]; _ValeurDegat = _ValeurDegat + 0.01; }; }; player setDamage -1; _vie = 1 - (getDammage player); hint format ["VOTRE VIE RESTANTE : %1",_vie]; TitleText ["Vous êtes revenus au combat, Dieu merci! Votre vie a été restauré!", "PLAIN", 2]; desertion = false; }; Everythings is working perfectly. But i've encountered a bug (at each execution of this script), wich surprise myself, happened when i back in the good area : the aim is going to a corner of my screen and impossible to take again control of it. It's independent of the view. Do you have any ideas ? A capture of the problem Thanks for your help! Share this post Link to post Share on other sites
Forxtop 10 Posted October 14, 2016 For my tests, i had to put an allowdamage false on my body. Without it, there is no problem. Share this post Link to post Share on other sites
nikiller 18 Posted October 14, 2016 hi, Have a look in setDamage comments "Setting a unit's damage to a negative value will set it's health to full, but impair their aim." cya. Nikiller. 1 Share this post Link to post Share on other sites
Forxtop 10 Posted October 15, 2016 Hey! Yes i read this comment but it was not that. When you are hurt, you have a bad aim. For me, the aim was not bad, just buggy, impossible (litteraly) to control. Thanks for your answer:p Edit : oh yes it could be a problem when i reset the life. Ok thanks ;) Share this post Link to post Share on other sites