ProcessHit
Provides functions to process a hit.
Functions
Section titled “Functions”GetBodyPart
Section titled “GetBodyPart”Given a part, returns the category of body part it falls into. Unknown body parts are classed as “Limb”.
Parameters
Section titled “Parameters”| Name | Type | Default | Description |
|---|---|---|---|
part | BasePart | The part. |
Returns
Section titled “Returns”"Limb" | "Body" | "Head"
GetItemDamage
Section titled “GetItemDamage”Gets damage that an item will do to a given part, accounting for damage falloff (if relevant).
Parameters
Section titled “Parameters”| Name | Type | Default | Description |
|---|---|---|---|
item | Item | ExplosionParams | The item. | |
hitPart | BasePart | The origin of the hit. | |
origin | Vector3 | The participant responsible for the hit. |
Returns
Section titled “Returns”number
The damage.
Processes a hit on a part, additionally processing prop / participant hit if needed.
Parameters
Section titled “Parameters”| Name | Type | Default | Description |
|---|---|---|---|
item | Item | ExplosionParams | The item. | |
attacker | Participant | The attacker. | |
hitPart | BasePart | The part that was hit. | |
hitPosition | Vector3 | The hit position. | |
normal | Vector3? | The hit normal. | |
origin | Vector3 | The origin of the hit. | |
relativeHitCFrame | CFrame? | The relative hit CFrame, in object space. | |
projectile | MapObject? | The projectile. |
Returns
Section titled “Returns”"Part" | "Prop" | "Participant"?
The type of thing that was hit. Nil if the hit is invalid.
Participant
Section titled “Participant”Processes a hit on a participant.
Parameters
Section titled “Parameters”| Name | Type | Default | Description |
|---|---|---|---|
item | Item | ExplosionParams | The item. | |
attacker | Participant? | The attacker. Can be nil if the hit is from an explosion. | |
victim | Participant | The target. | |
hitPart | BasePart | The part that was hit. | |
hitPosition | Vector3 | The hit position. | |
normal | Vector3? | The hit normal. | |
origin | Vector3 | The origin of the hit. | |
relativeHitCFrame | CFrame? | The relative hit CFrame, in object space. | |
projectile | MapObject? | The projectile. |
Processes a hit on a prop.
Parameters
Section titled “Parameters”| Name | Type | Default | Description |
|---|---|---|---|
item | Item | ExplosionParams | The item. | |
attacker | Participant? | The attacker. Can be nil if the hit is from an explosion. | |
prop | Prop | The target prop. | |
hitPart | BasePart | The part that was hit. | |
hitPosition | Vector3 | The hit position. | |
normal | Vector3? | The hit normal. | |
origin | Vector3 | The origin of the hit. | |
relativeHitCFrame | CFrame? | The relative hit CFrame, in object space. | |
projectile | MapObject? | The projectile. |