HP ADDon

Started by FinchDon, Aug 20, 2015, 03:35 PM

Previous topic - Next topic

FinchDon

I saw Ksna Random Cash system i so made like that but didn't work :-\

There is Code

randhp <- [ 10, 20, 25, 30, 35, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100 ];
function onPlayerKill( killer, player, weapon, reason )
{
   local a = randhp[rand()% randhp.len()]
   killer.Health + a ;
   ePrivMessage( "Health Add on " + a + ".", killer );
}
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

Stormeus

killer.Health + a should be killer.Health += a. Changing someone's health requires assigning their health a value; all you did was add their health and the random HP without doing anything with it.

What I gave you is the same as doing killer.Health = killer.Health + a;

FinchDon

For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

Thijn

Quote from: FinchDon on Aug 20, 2015, 04:15 PMi have to use killer.Health += a; ?
....

Why ask when you can easily just test it out? Do we really have to tell you everything before you do some testing yourself?