πŸ’¬

Community answer

Collected from the ACE community Discord archive around 2022-10-26. It may be informal or outdated β€” anyone can edit this page to improve it. Original discussion

Detecting the player's active weapon class

🎯 ACEUpdated 2 days agoβ€’0 views
Use weapon:getClass() (e.g. "weapon_fists" for fists) instead of the print name. Guard the access with isValid(owner:getActiveWeapon()) before reading the class…

How to check the client's active weapon in SF without errors on death

Use weapon:getClass() (e.g. "weapon_fists" for fists) instead of the print name. Guard the access with isValid(owner:getActiveWeapon()) before reading the class - the active weapon entity is nil when the owner dies, which caused 'Entity is not valid' tick errors.

Was this article helpful?

See More

Discussion(0)

No comments yet. Be the first to ask a question!

Have a question? Sign in to join the discussion.