Frictional Games Forum (read-only)

Full Version: Give yourself damage the damage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I found the script but is didnt work. Can someone give me te real one. and on what amount the player dies with full health?
100 health is max I think... But tell more info about this script? This makes no sense
Cause might not be in script, instead when you call it, then condition doesn't trigger or work Smile!
Now i wanted to set an area. and when i etered that area i will die. but the script i used didnt really work wel
void GivePlayerDamage(float afAmount, string& asType, bool abSpinHead, bool abLethal);
Reduces the health of the player.
afAmount - amount of damage done to health
asType - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws or Slash)
abSpinHead - changes the camera view when damage is dealt
abLethal - set to true if player can die from given damage
I guess this is what you want:
GivePlayerDamage(100, "BloodSplat", true, true);

There are tons of script tutorials for monster events where you walk somewhere and it spawns the monster. Now with this just replace the monster related things with that giveplaer damage and youre fine.

edit. okay use the functions below, they looks simpler...
are you sure you're using either

SetPlayerHealth(0.0f);?
AddPlayerHealth(-100.0f);?

Either of these scripts will instantly kill the player as long as their health is not raised above 100

Edit: Of course, if you want effects to be played when you are injured/killed, then the functions Khyrpa suggested would be more suitable Smile But the one's I've posted should be good enough for now.
oke thanks ^^