ProcessTrapHit - ObjectReference

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Member of: ObjectReference Script

Tells this reference to handle getting hit by a trap, dealing the specified amount of damage and possibly applying a pushback force.

Syntax[edit | edit source]

Function ProcessTrapHit(ObjectReference akTrap, float afDamage, float afPushback, float afXVel, float afYVel, \
  float afZVel, float afXPos, float afYPos, float afZPos, int aeMaterial, float afStagger) native

Parameters[edit | edit source]

  • akTrap: Which trap reference just hit this reference.
  • afDamage: How much damage to deal to this reference.
  • afPushback: How far back to push this reference.
  • afXVel: The impact vector's X coordinate.
  • afYVel: The impact vector's Y coordinate.
  • afZVel: The impact vector's Z coordinate.
  • afXPos: The impact point's X coordinate.
  • afYPos: The impact point's Y coordinate.
  • afZPos: The impact point's Z coordinate.
  • aeMaterial: Opaque integer value denoting what material the trap is. (Usually received via an OnTrapHitStart event)
  • afStagger: How much to stagger the target, 0.0-1.0.

Return Value[edit | edit source]

None.

Examples[edit | edit source]

; Process a trap hit on the player with just a little bit of damage, and no pushback or stagger, with a position
; velocity, and material from somewhere else (probably OnTrapHit)
Game.GetPlayer().ProcessTrapHit(SpikeTrap, 1.0, 0.0, xvel, yvel, zvel, xpos, ypos, zpos, material, 0.0)

See Also[edit | edit source]