# SetDmg

`pl:SetDmg(` [**ⁿᵘᵐᵇᵉʳ**](https://wiki.facepunch.com/gmod/number) damage`)`

## ▸ Parameters

&#x20;     ***`int`**`    ``damage`*\
&#x20;                         amount of total damage to set for player

## ▸ Description

&#x20;        Sets a player's total damage dealt to other players while in Build Mode\
&#x20;        Used for the punishment system.

## ▸ Example

{% tabs %}
{% tab title="Example 1" %}

```lua
local function pl_onjoin( pl )
    pl:SetDmg( 0 )
end
rhook.new.gmod( 'PlayerInitialSpawn', 'builderx_pl_join_init', pl_onjoin )
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://builderx.rlib.io/developers/functions/setdmg.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
