# sam.Rank.add

> #### sam.Rank.add( [string](https://wiki.facepunch.com/gmod/string) rank\_name,  *(*[*optional*](https://sam.goobie.me/info-read/optional)*)* [string](https://wiki.facepunch.com/gmod/string) inherit\_from *=* *"user",*
>
> #### *(*[*optional*](https://sam.goobie.me/info-read/optional)*)* [number](https://wiki.facepunch.com/gmod/number) immunit&#x79;*, (*[*optional*](https://sam.goobie.me/info-read/optional)*)* [number](https://wiki.facepunch.com/gmod/number) ban\_limit )

## Description

Create a rank.

{% hint style="info" %}
Default values for immunity & ban\_limit will be taken from the rank to inherit from.
{% endhint %}

## Aguments

1. [**string**](https://wiki.facepunch.com/gmod/string) **rank\_name**
2. #### *(*[*optional*](https://sam.goobie.me/info-read/optional)*)* [string](https://wiki.facepunch.com/gmod/string) inherit\_from *=* *"user"*
3. #### *(*[*optional*](https://sam.goobie.me/info-read/optional)*)* [number](https://wiki.facepunch.com/gmod/number) immunity
   1. #### will be clamped between 2 and 99
4. #### *(*[*optional*](https://sam.goobie.me/info-read/optional)*)* [number](https://wiki.facepunch.com/gmod/number) ban\_limit
   1. #### will be clamped between 0 and 31536000

## Example

```lua
sam.Rank.add("super_super_super", "superadmin")
print("created a super_super_super rank that inherits from superadmin!")

sam.Rank.add("trusted_user")
print("created a trusted_user rank!")
```
