Jump to content
Sign in to follow this  
dr death jm

razor wire to cause damage.

Recommended Posts

realy noob question, but i have razor wire on mission id like it to cause a small amout of damage.

any help thanks.

Share this post


Link to post
Share on other sites

if using the editor; give the wire the name "barbWire" and put this in it's Init:

this execVM"barbwiredamage.sqf";

then create a file called barbwiredamage.sqf, save it in the root of your mission folder and put this inside it:

Private [ "_distance" ];
while (alive player) do {
sleep 1;
_distance = player distanceSqr barbWire;
if (_distance < 0.1) then { sleep 0.5; player setDamage 0.05; };
} else { hint"W00ps, you died. I should stop executing this script."; };

Now you have one barbwire that will give you the thing you want. But if you are going to put a shitload (more than 30) razor wires in your mission, it would be better not to use this method. Something to do with script spam.

---------- Post added at 15:05 ---------- Previous post was at 14:46 ----------

let me know if it works :) I just made that out of the top of my head. Bored at work xD

Edited by IT07

Share this post


Link to post
Share on other sites

awesome thanks...

ill lrt you know in a bit giving kids lunch and nap...

---------- Post added at 01:21 PM ---------- Previous post was at 12:38 PM ----------

na didnt work ...

this execVM"barbwiredamage.sqf"; <--- gave me expect nothing

so i edited, this = execVM"barbwiredamage.sqf"; but nothing happend ...:j:

Share this post


Link to post
Share on other sites

ill try that..

nope ... no script errors but nothing hapends, Im jumping all over the barbwire.

Edited by Dr Death JM

Share this post


Link to post
Share on other sites
Private [ "_distance" ];
    while {alive player} do {
     sleep 1;    
      _distance = player distance _this;
        if (_distance < 3) then {// adjust for best results
	    sleep 0.5;  
	      player setDamage (damage player)+0.05;// 0.05 = damage each second
	      };   
    };           
hint "W00ps, you died. I should stop executing this script."

Share this post


Link to post
Share on other sites

testing it now

awesome works...

thanks alot all of you ...

1 more question how to add the player to yell or so sort a responce to being hurt by the razor wire?

Edited by Dr Death JM

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  

×