Posts: 3,715
Threads: 358
Joined: Apr 2012
Reputation:
0
I have a question.
How do you make a RolePlay injured system? Like after you died, You spawn again but injured
Displaying: "You're injured, Call an EMS, /service ems"
Like that.
What should i use, OnPlayerDeath or what?
Any codes?
Posts: 295
Threads: 6
Joined: Apr 2013
Reputation:
0
when they die get their position, onplayerspawn (check if they're dead), set their position and apply an animation freezing and locking their x y z so they can't move. put a gametext over it saying what you want
Posts: 2,698
Threads: 37
Joined: Mar 2012
Reputation:
0
I haven't ever played as a RPG player, though for RP servers - it would be looking good in case if the player reaches the minimum HP specified, he/she gets injured and the walk-style then changes. Making them not possible to jump and in case if the velocity is being increased than the limit, making the player fall would be good.
Under OnPlayerDeath, you are not able to ask the player to call an EMS service as they'd get redirected to OnPlayerSpawn (OnPlayerDeath calls only when player is dead). Check if player's HP is too low or do as a server sided HP system and calculate the amount. And then you can use animations.
Posts: 182
Threads: 10
Joined: Apr 2013
Reputation:
0
use on OnPlayertakedamage
or use a timer to check the player's health .
Posts: 1,794
Threads: 104
Joined: Feb 2012
Reputation:
0
You can't do it using OnPlayerDeath callback, I've tried it and it didn't work however I recommend you to apply a timer checking the player's health everyone second if it reaches (1) for example then apply an animation to him, freeze him, GameTextForPlayer, and do whatever else you want to do.
Posts: 3,715
Threads: 358
Joined: Apr 2012
Reputation:
0
@DaniceMcHarley.
The way i use is this, Once the player has 0 health, He will respawn to his last position and the injured system would trigger with a timer repeating every 1 second, Showing him a gametext - Playing the dead animation, If the animation didn't match with the dead animation, I play the dead animation ( To avoid playing the animation every 1 second ). Once his health reach 5.0 (Using a health checker), I will kill the timer and respawn him in the hospital starting with 1.0 health.
- Would that work perhaps?