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.

How to know if the player is punching and not using melee weapon?

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Post Reply
NearHuscarl
Superfighter
Superfighter
Posts: 97
Joined: Thu Feb 07, 2019 4:36 am

How to know if the player is punching and not using melee weapon?

Post by NearHuscarl » Sat Jul 20, 2019 5:13 pm

Code: Select all

IPlayer.IsMeleeAttacking
return true if player is melee attacking with or without melee weapon. But what if I need to know when the player is attacking without weapon (bare hand)?
0 x
Image

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Sat Jul 20, 2019 5:31 pm

You can check
IPlayer.CurrentWeaponDrawn == WeaponItemType.NONE
0 x
Gurt

NearHuscarl
Superfighter
Superfighter
Posts: 97
Joined: Thu Feb 07, 2019 4:36 am

Post by NearHuscarl » Sun Jul 21, 2019 7:28 am

That would do it. Thank you!
0 x
Image

Post Reply