Skip to content

ProcessHit

Provides functions to process a hit.

Given a part, returns the category of body part it falls into. Unknown body parts are classed as “Limb”.

NameTypeDefaultDescription
partBasePartThe part.

"Limb" | "Body" | "Head"

Gets damage that an item will do to a given part, accounting for damage falloff (if relevant).

NameTypeDefaultDescription
itemItem | ExplosionParamsThe item.
hitPartBasePartThe origin of the hit.
originVector3The participant responsible for the hit.

number

The damage.

Processes a hit on a part, additionally processing prop / participant hit if needed.

NameTypeDefaultDescription
itemItem | ExplosionParamsThe item.
attackerParticipantThe attacker.
hitPartBasePartThe part that was hit.
hitPositionVector3The hit position.
normalVector3?The hit normal.
originVector3The origin of the hit.
relativeHitCFrameCFrame?The relative hit CFrame, in object space.
projectileMapObject?The projectile.

"Part" | "Prop" | "Participant"?

The type of thing that was hit. Nil if the hit is invalid.

Processes a hit on a participant.

NameTypeDefaultDescription
itemItem | ExplosionParamsThe item.
attackerParticipant?The attacker. Can be nil if the hit is from an explosion.
victimParticipantThe target.
hitPartBasePartThe part that was hit.
hitPositionVector3The hit position.
normalVector3?The hit normal.
originVector3The origin of the hit.
relativeHitCFrameCFrame?The relative hit CFrame, in object space.
projectileMapObject?The projectile.

Processes a hit on a prop.

NameTypeDefaultDescription
itemItem | ExplosionParamsThe item.
attackerParticipant?The attacker. Can be nil if the hit is from an explosion.
propPropThe target prop.
hitPartBasePartThe part that was hit.
hitPositionVector3The hit position.
normalVector3?The hit normal.
originVector3The origin of the hit.
relativeHitCFrameCFrame?The relative hit CFrame, in object space.
projectileMapObject?The projectile.