Player Data
scripts/vscripts/alyxlib/player/data.lua
Functions
SyncEquippedWeaponState
Syncs the equipped weapon state of the player with the given weapon classname.
If no classname is given, the weapon classname will be determined from the player's criteria.
This is used internally on weapon switch to determine equipped weapons.
Parameters
classname(optional)
string
The classname of the weapon to synchandle(optional)
EntityHandle
The entity handle of the weapon to sync
Returns
-
EntityHandle?
weaponHandle
The entity handle of the weapon that was equipped -
CPropVRHand?
handHandle
The entity handle of the hand that the weapon was equipped to
RestorePreviouslyEquippedWeaponState
Restores the previously equipped weapon state.
Parameters
fireEvent(optional)
boolean
trueto force-fire theweapon_switchevent
PauseWeaponStateSync
Pauses weapon state synching. This will prevent the weapon_switch player event from firing.
ResumeWeaponStateSync
Resumes weapon state synching. This will allow the weapon_switch player event to fire.
WeaponStateSyncPaused
Checks if weapon state synching is paused.
GetDefaultWeaponOffset
Returns the default weapon offset for the given weapon classname and hand.
Parameters
classname
string
The classname of the weaponhand
CPropVRHand,number
The hand to get the offset for
Returns
- Vector
The default weapon offset, or (0, 0, 0) if not found