Builder-X
Browse ScriptsDownload RLIB
v2.x
v2.x
  • Introduction
  • Showcase
  • Changelog
    • ◾2.0.1.0
    • ◾2.0.0.0
  • FAQ
    • ◾Addon Won't Show
    • ◾Incompatible Addons
    • ◾Damage Issues
    • ◾Modified Script
    • ◾Refunds
    • ◾Script Errors
    • ◾When Are Updates?
  • ❱ Setup
    • ◾Install
    • ◾Verify
    • ◾Workshop
    • ◾Docs/Web
  • ❱ Configuration
    • ◾Env
    • ◾Fonts
    • ◾Languages
    • ◾Settings
      • ▸sh_cfg_bg
  • ❱ First Use
    • ◾Binds
  • ❱ Developers
    • ◾Functions
      • 🟦GetBuild
      • �� SetBuild
      • 🟦GetDmg
      • 🟦SetDmg
      • 🟦AddDmg
    • ◾Hooks
      • 🔗builderx.mode.onswitch
      • 🔗builderx.pl.ondamage
      • 🔗builderx.pl.onjoin
      • 🔗builderx.pl.onnoclip
Powered by GitBook
On this page
  • ▸ Parameters
  • ▸ Description
  • ▸ Example
  1. ❱ Developers
  2. Hooks

builderx.pl.ondamage

🟥 𝗦𝗘𝗥𝗩𝗘𝗥

Previousbuilderx.mode.onswitchNextbuilderx.pl.onjoin

Last updated 4 years ago

builderx.pl.ondamage( attacker, victim, damage)

▸ Parameters

ply attacker player object (player doing damage)

ply victim player object (player injured)

int damage returns total damage attacker has done in build mode

▸ Description

Runs when player in build mode deals damage to another player (or kills).

Will not run if block damage settings enabled because there won't be damage to report.

▸ Example

local function your_hook( attacker, victim, damage )

    // your custom hook function here

end
hook.Add( 'builderx.pl.ondamage', 'your_hook_id', your_hook )
hook.Add( 'builderx.pl.ondamage', 'your_hook_id', function( attacker, victim, damage )

    // your custom hook function here

end )
local function your_hook( attacker, victim, damage )
    print( attacker )
    print( victim )
    print( damage )
end
hook.Add( 'builderx.pl.ondamage', 'your_hook_id', your_hook )

-- print returns --

Player [1][player_name]
Player [3][Bot03]
19
local function your_hook( attacker, victim, damage )

    // your custom hook function here

end
rhook.new.rlib( 'builderx_mode_ondamage', your_hook )
◾
🔗
ᵖˡᵃʸᵉʳ
ᵖˡᵃʸᵉʳ
ⁿᵘᵐᵇᵉʳ