penetration

Usage: mods.penetration.{method}

circle-exclamation

FireBullet

Function

Simulates a bullet fired from a specific weapon.

circle-info

This function can be expensive, use it moderately.

Arguments

Name
Type
Description

origin

Where the bullet is coming from

delta

The direction the bullet is going, computed as end_point - origin_point

weapon

The gun the bullet is being fired from

target

The target player, can be nil

clamp

boolean

Whether or not to clamp the tracing to the player.

Returns

Type
Description

boolean

If there was an error during simulation.

The penetration data

Example

local eye_position = local_player:GetEyePos()
local weapon = local_player:GetActiveWeapon()
local enemy_position = enemy:GetHitboxCenter(EHitBox.HEAD)

local _, pen = mods.penetration.FireBullet(eye_position, enemy_position - eye_position, 
                                         weapon, enemy)

print(pen.damage, pen.hitgroup)

ScaleDamage

Function

Scales up the damage from a weapon given a hitgroup and, optionally, a player.

Arguments

Name
Type
Description

damage

number

The damage to be scaled

weapon

The gun the bullet is being fired from

hitgroup

The desired hitgroup.

target

The target player, can be nil

Returns

Type
Description

number

The scaled damage

Example

Last updated