Changing player's score + other things

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Stuk

Attempting US
Aug 8, 2004
3
0
0
35
England
www.thejunkyard.co.uk
In my attempt to start learning Unreal Script I'm trying to make a small mutator that does the opposite of the Regen Mutator, ie. Reduces your health. I've coded the reduction bit (nice and simple :) ), but now I want to kill the player when their health reaches zero. At the moment I'm using this:
Code:
if (C.Pawn.Health <= 0)
            {
                C.Pawn.LifeSpan = 0.1;
            }
I don't feel like this is the correct way, so any suggestions would be helpful in respect to this.
I would also like to take 1 from the players score when they die, which with this code doesn't happen, so I tried doing it like this:
Code:
PlayerReplicationInfo.Score--;
which throws up an error. As I said, I'm still learning, and any pointers in the right direction would be appreciated.

Thanks, Stuk

(Now lets hope I don't get flamed for this first post ;) )
 

Stuk

Attempting US
Aug 8, 2004
3
0
0
35
England
www.thejunkyard.co.uk
Whoa! Quite a few replies while I was away yesterday. Thanks for the help, and although I got it working to my liking, the TakeDamage and PawnDied functions are ones I'm looking into for future use (or to maybe use in this Mutator).
Thanks again guys.