Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Player health checking

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
Diamond TH
Fighter
Fighter
Posts: 21
Joined: Fri Sep 14, 2018 10:44 am
Title: Fairplayer
SFD Account: Diamond_TH
SFD Alias: Diamond_TH
Started SFD: May 2015
Location: Russia
Gender:
Age: 20
Contact:

Player health checking

Post by Diamond TH » Sat Oct 06, 2018 11:07 am

Hello! I have been experimenting with the Script API and i wanted to do something like:

Code: Select all

if(ply.CurrentHealth <= 30)
{
    Game.PlayEffect("CFTXT",ply.GetWorldPosition(),"I have low health!");   
}
But i couldn't find any possibility for player health checking. Do we have something for this in here?
If not, do we have a way to realize that somehow?
0 x
Image - Noob SuperFighter saying

User avatar
Sree
Superfighter
Superfighter
Posts: 325
Joined: Sun May 08, 2016 8:19 pm
SFD Account: phasmic
SFD Alias: sree
Gender:
Age: 23

Post by Sree » Sat Oct 06, 2018 11:17 am

You've to use the GetHealth() function of IPlayer interface
1 x

User avatar
Diamond TH
Fighter
Fighter
Posts: 21
Joined: Fri Sep 14, 2018 10:44 am
Title: Fairplayer
SFD Account: Diamond_TH
SFD Alias: Diamond_TH
Started SFD: May 2015
Location: Russia
Gender:
Age: 20
Contact:

Post by Diamond TH » Sat Oct 06, 2018 11:40 am

Sree wrote:
Sat Oct 06, 2018 11:17 am
You've to use the GetHealth() function of IPlayer interface
I tried this out, and it worked! Thank you! I have no questions now. (it was obvious tbh XD)
0 x
Image - Noob SuperFighter saying

Post Reply