This forum is locked and will eventually go offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk

Forum rules

Player health checking

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Locked
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: 22
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: 25

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: 22
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

Locked