Jump to content

Perks, Radiation, & Death


PAPVAFS11

Recommended Posts

I'm working on a perk that directly converts accumulated radiation into health damage. I've made the perk and added some additional radiation effects that have the perk as one of the required conditions to start draining the player's health. However, whether the player has the perk or not, you still end up taking damage from the effects. I've tried adding effects to the perk itself (GetRadiationLevel >= [Amount], Modify Recovered Health: Add Value -0.50), but to no avail.

 

I'm not much of a scripter, so the solution is eluding me here. Could someone give me a shove in the right direction?

Link to comment
Share on other sites

Create a quest and use a gamemode script to do the conversion, for example:

 

short Rads

begin gamemode

if player.hasperk "Your Perk" == 1

;you can add other conditions here,like "if player.getav radiationrads >= 200"

set rads to player.getav rediationrads

set Rads to Rads / 2 ;this will cut the damage by half,if you want an equivalent Rad to Health damage don't use this line

player.damageav health Rads ;damage player,if you want a constant damage,substitute "Rads" for the damage

player.modav RadiationRads -Rads ;remove all rad from the player,if you don't want to remove rad,delete this line.

endif

end

I typed it now,so don't know if i miss-typed somewhere...

 

this will only work with the player,so if you want it to affect npcs,there is a way using conditions in the ability,but its to much work to explain... :laugh:

Link to comment
Share on other sites

rediationrads

Is this a potential mistype? I've dabbled in GMod LUA quite a few times before and I know how much of a pain it is to find out a bugged weapon was all because of a simple spelling error.

 

The help is greatly appreciated, I'm going to try this out now.

 

Edit: Tested it with my own modified version of the code and it's working almost flawlessly. Almost because I need to up the rate at which the damage is applied. I didn't say it before, but I want this to slowly hurt the player over time as well as decrease his radiation level.

Edited by PAPVAFS11
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...