Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
ReikoKasumi

[Help] Allowing a unit to be wounded but not killed?

Recommended Posts

I tried several time to allow the player to be wounded but not killed. I tried this: "this addeventhandler ["randomtext", {if (player damage) < 0.5 then rs1 allowdamage false}];"

with "rs1" being the name of that unit. I have tried "this" and "_this".

This is probably not the right code to use at the start.

Can someone help please?

Share this post


Link to post
Share on other sites
{if((rs1 damage) < 0.5) then {rs1 allowdamage false};}

I typed that in but it give me an blank error thing. tried it with eventhandler still doesn't work. where/how is it supposed to be written?

Share this post


Link to post
Share on other sites

You might want to look into the handleDamage event handler (See the Biki page). Basically, this handler returns the amount of damage that should be done to the unit, so if you cap it so that it always has some damage left (i.e. make it so that the unix will never drop below 0.5), then it can't be killed anymore

Edited by Varanon
typo

Share this post


Link to post
Share on other sites
You might want to look into the handleDamage event handler (See the Biki page). Basically, this handler returns the amount of damage that should be done to the unit, so if you cap it so that it always has some damage left (i.e. make it so that the unix will never drop below 0.5), then it can't be killed anymore

I read that link then read (Celery's explanation) about handledamage and it sounds like people are saying the first aid modules override handledamage.

And i read something about the unit has to be local or something, so will it work on my friends (I always host)?

Thanks. I'll see if i can ever come up with anything. (I am kind of new to scripting so I don't know much)

Share this post


Link to post
Share on other sites
Sign in to follow this  

×