10-05-2011, 06:40 PM
10-05-2011, 06:46 PM
100 health is max I think... But tell more info about this script? This makes no sense
10-05-2011, 07:29 PM
Cause might not be in script, instead when you call it, then condition doesn't trigger or work !
10-05-2011, 08:41 PM
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
10-05-2011, 08:53 PM
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...
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...
10-05-2011, 08:54 PM
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 But the one's I've posted should be good enough for now.
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 But the one's I've posted should be good enough for now.
10-05-2011, 09:03 PM
oke thanks ^^