Skip to content

Logging custom TTT equipment events

Michael Hawkins edited this page Aug 14, 2022 · 4 revisions

You can modify the code for TTT weapons and entities to provide more information for the damage logs.
This is done by calling the hook TTTEquipmentUse.

Example

-- In your weapon's code

SWEP.PrintName = "My Custom Weapon"

function SWEP:PrimaryAttack()
    local playerUsingEquipment = self:GetOwner()
    local equipment = self
    local description = "Did something cool"
    hook.Run("TTTEquipmentUse", playerUsingEquipment, equipment, description)
end

In-game, this looks like the following:
example preview