View Full Version : Healing weapon?

16th Dec 2001, 02:18 PM
How do code a weapon so when it's projectile touches a player on my team it "heals" them? So far I can only get it to not hurt them, not give them help.

Or, how do I spawn an item (when i fire a weapon) right at a player's location so they pick it up instantly?

16th Dec 2001, 02:40 PM
The healing is quite simple:
simulated function ProcessTouch(Actor Other, Vector HitLocation)
if ( Pawn(Other) != None && (insert your team check here) ) {
Pawn(Other).Health += (insert healing amount);
if (Pawn(Other).Health > (a maximum value, usually 199) )
Pawn(Other).Health = (the maximum value);
//insert you additional code here

That spawning stuff is easy, too:
function Fire(float Value)
//other Fire() stuff

Although this works, you should change the spawn().giveto() to something longer. (Include some error detection.)

16th Dec 2001, 03:34 PM
Thank you so much!!!

If I were there, i would hug you right now!!!

16th Dec 2001, 04:30 PM
Send 'im a Log in the mail! All kids love Log!

17th Dec 2001, 06:37 AM
smoke, youve been hyping log quite a bit for a while now... You work for Blammo?

17th Dec 2001, 10:17 PM
It's Lo-og, Lo-og; it's big, it's heavy, it's wood.......
Anyone for a game of Monotony?