# Getting Started

This documentation serves the purpose of helping server owners install, setup, and use your new copy of this script.

{% hint style="warning" %}
**v1.x.x** has reached EOL \[end-of-life] and is no longer supported.\
**Please select the latest version** from the list to the top left.

If you are running an older version of the script, you will be asked to upgrade to the latest version to receive support. This helps with bugs, stability, and optimizations that the newer version will offer.
{% endhint %}


# Introduction

This documentation serves the purpose of helping server owners install, setup, and use your new copy of this script.

![YL-lang\]](https://img.shields.io/badge/language-lua-2A61CE.svg?logo=lua)![YL-Type\]](https://img.shields.io/github/manifest-json/description/im-richard/rlib.svg?color=D84B4B\&filename=manifest%2Fbuilderx%2Fmanifest.json\&label=type)![YL-Ver\]](https://img.shields.io/github/manifest-json/v/im-richard/rlib.svg?filename=manifest%2Fbuilderx%2Fmanifest.json)![YL-Req\]](https://img.shields.io/github/manifest-json/libreq/im-richard/rlib.svg?color=288A51\&filename=manifest%2Fbuilderx%2Fmanifest.json\&label=rlib)![YL-Updated\]](https://img.shields.io/github/manifest-json/updated/im-richard/rlib.svg?color=D84B75\&filename=manifest%2Fbuilderx%2Fmanifest.json\&label=last)![YL-ID\]](https://img.shields.io/github/manifest-json/script/im-richard/rlib.svg?color=D8714B\&filename=manifest%2Fbuilderx%2Fmanifest.json\&label=id)![YL-hits\]](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fim-richard%2Frlib\&count_bg=%235A3DC8\&title_bg=%23555555\&title=hits\&edge_flat=false)

![](/files/-MSzZ9Yo5bSNZkuVOxp2)

## ▸Compatibility ◾ Addons

![ULX](https://g.rlib.io/gms/badges/addons/86/u.png) ![XAdmin](https://g.rlib.io/gms/badges/addons/86/x.png) ![SAM](https://g.rlib.io/gms/badges/addons/86/s.png) ![ServerGuard](https://g.rlib.io/gms/badges/addons/86/sg.png)

## ▸Compatibility ◾ Gamemodes

![All Gamemodes](https://g.rlib.io/gms/badges/gm/86/gm_all.png)

## ▸About

**Builder-X** allows server owners to support two different groups of players on the same server; **Builders** and **PVPers**. Players are given the ability to switch between Build or PVP mode; giving builders special permissions so that they can play without fear of being killed.

With a wide variety of settings that can be customized; server owners can give builders such things as automatic immunity from damage, as well as noclip. Builders will also be stripped of any weapons they currently possess, and will be given back once the player switches from Build mode to PVP mode.

On top of these restrictions; a built-in damage / punishment system is also available, which monitors for **Kills** or **Damage** of players; depending on which type is set by the server owner. If a builder does damage to other players while in build mode; they will be warned, as well as a notice being sent to the server staff. If the builder continues to do damage; they will be kicked from the server. The server owner can determine which type to monitor; and set the threshold for each type. User groups can also be set as protected from the punishment system (such as staff) in the configuration files.

## ▸Features

* Supports two modes: **Build Mode** & **PVP Mode**.<br>

* **Build Mode** can do any of the following:

  * Ensure that a player cannot take damage
  * Strip and save all player's current weapons until they return to PVP mode
  * Monitor for damage of other players **( see punishment detection )**
  * Restrict a builder from spawning weapons / entities
  * Place a halo (glow) around builders on the map to indicate the mode they are playing under
  * Fully restore their health once they switch to Build Mode
  * Give special loadouts to players who enter Build Mode.
    * **Default**: *weapon\_physgun, gmod\_tool, gmod\_camera*
  * Allow players to have **NOCLIP** ability
    * Can be given automatically when player joins Build Mode *OR*
    * Can be activated by the player when needed using **!fly** chat command
  * Ability to force respawn after player leaves Build Mode

* **Weapon / Tool Stripping:**

  * Players who enter build mode will have their current weapons & tools stored to a temp save.
  * Player will enter build mode and be given whatever is listed in the Build Mode loadout list
  * Once player returns to PVP mode; they will be given back all tools / weapons they had prior to switching to Build Mode

* **Anti-Abuse** system:
  * Players must wait X seconds before switching between modes back and forth
  * If player takes damage; they must wait X seconds before changing modes to prevent PVP abuse<br>

* **Damage Blocking**:

  * Script comes with numerous levels of damage blocking
  * Stops a player in build mode from taking any type of damage what-so-ever
  * Includes **Advanced Damage Mode**
    * Ensures that players in Build Mode cannot hurt PVPers, and PVPers cannot hurt Builders

* **Whitelist Spawning**:
  * Server owner can restrict players in Build Mode from spawning SENTs & SWEPs (entities & weapons).
  * If SENT and SWEP spawn restriction enabled; player can only spawn what is configured in the whitelist table.
  * This can be used on top of other restriction addons installed on your server.
  * Can be turned off completely so that other addons can manage this aspect.<br>

* **3rd Part Support:**
  * Support for **admin mods**:
    * [**ULX**](https://ulyssesmod.net/downloads.php)
    * [**xAdmin**](https://www.gmodstore.com/market/view/xadmin-2-admin-mod)
    * [**SAM**](https://www.gmodstore.com/market/view/sam)
    * [**ServerGuard**](https://www.gmodstore.com/market/view/serverguard)
  * Support for **addons**:
    * **Pointshop Airdrops DLC**
  * Admin Mod **Permissions:**

    * Get / Reset **Damage punishment counter**
    * Force set **mode** on player
    * Force interface open for player
    * Force interface refresh for player

* **Binds & Activation**:

  * Interface can be activated using any of the following:
    * Keybind ( default: **F8** )
    * Chat ( **!mode** )

* **Live and Static Backgrounds**
  * Supports web URLs for both static and live backgrounds.
  * **Live Backgrounds** utilize **.webm** videos
  * Background source files provided in download


# Showcase

Preview screenshots of this addon

## ▸ Static Images

## ▸ Animated Images

Please note that animated gifs may show sluggish animations due to FPS limits of the image itself. In-game animations are smooth.


# Changelog

A descriptive list of changes made to this script

### Which version do you want to see changes for?

The most recent update is listed at the top, and the oldest at the bottom

| Version                                  | Build                                                                       |        |
| ---------------------------------------- | --------------------------------------------------------------------------- | ------ |
| [**2.0.1.0**](/changelog/2.0.1.0)        | ![NL-build-stable\]](https://img.shields.io/badge/stable-4DA954.svg?label=) | latest |
| [**2.0.0.0**](/changelog/2.0.0.0-stable) | ![NL-build-stable\]](https://img.shields.io/badge/stable-4DA954.svg?label=) |        |


# 2.0.1.0

This is a detailed changelog for the specified release above.

## ◾ Overview

* `[ + ]` [**new setting to bypass cooldowns for usergroups**](/changelog/2.0.1.0#new-setting-to-bypass-cooldowns-for-usergroups)
* `[ ^ ]` [**supports multiple chat/ console commands**](/changelog/2.0.1.0#supports-multiple-chat-console-commands)
* `[ % ]` [**fixed GetBuild error when advanced damage is enabled**](/changelog/2.0.1.0#fixed-getbuild-error)
* `[ % ]` [**fixed compatibility issue with eprotect addon returning error on SetTitle**](/changelog/2.0.1.0#fixed-eprotect-compatibility)

## ◾ File Changelog

### &#x20;   ◾ **CONFIGS**

* builderx\cfg\sh\_cfg\_general.lua
* builderx\cfg\sh\_cfg\_modes.lua

### &#x20;   ◾ **GENERAL**

* builderx\core\cl\_init.lua
* builderx\core\sv\_init.lua
* builderx\core\sv\_penalty.lua
* builderx\core\sv\_psay.lua
* builderx\pnl\cl\_pnl\_root.lua
* builderx\sh\_env.lua

## ◾ Changes

####

### ◾ New Setting to Bypass Cooldowns for Usergroups

Added a new setting within **`sh_cfg_modes.lua`** which allows for certain usergroups to bypass damage and switch cooldowns.

{% tabs %}
{% tab title="lua\modules\builderx\cfg\sh\_cfg\_modes.lua" %}

```lua
/*
*   modes > cooldown > bypass
*/

    cfg.modes.cooldown_bypass =
    {
        [ 'owner' ] 	        = true,
        [ 'superadmin' ] 	    = true,
        [ 'admin' ] 	        = false,
        [ 'operator' ]          = false,
        [ 'donator' ]           = false,
        [ 'user' ]              = false
    }
```

{% endtab %}
{% endtabs %}

####

### ◾ Supports multiple chat/ console commands

Addon now allows for multiple commands to be bound to the console and chat commands.

####

### ◾ Fixed GetBuild Error

Customers reported an issue with a GetBuild error when **`cfg.build.bAdvBlockDmg`** enabled

####

### ◾ Fixed eProtect Compatibility

Resolved an issue which caused a random error with customers also using eProtect related to SetTitle()


# 2.0.0.0

This is a detailed changelog for the specified release above.

This release is the first of the official rewrite for this script. Minor interface changes will be made in a future release, but for now, the rewrite is stable and can be utilized on a production server.

### ▸Interface Revamp

The entire interface has been updated. It also greys out the mode that the player is currently in and displays the other available mode(s) to select from.

![](/files/-MSrgVqx7Gib39XbQSd7)

###

### ▸Static & Live Wallpapers

This version includes a clean flat interface as the default theme. However, static and live wallpapers have been added to the configs. These allow you to display images as the background on the interface; or server owners can enable live wallpapers which support **.webm** videos.

![](/files/-MSsq1VVINPZn--zA_SL)

###

### ▸Background Materials

Script now supports adding materials to the interface for a steam workshop hosted background. These settings can be found in the new **lua\modules\builderx\cfg\sh\_cfg\_bg.lua** file.

{% tabs %}
{% tab title="lua\modules\builderx\cfg\sh\_cfg\_bg.lua" %}

```lua
cfg.bg.material.enabled     = true
cfg.bg.material.list        =
{
    'path/to/material_1.png',
    'path/to/material_2.png',
}
cfg.bg.material.clr         = Color( 255, 255, 255, 255 )
```

{% endtab %}
{% endtabs %}

In order for these materials to work; you MUST create your own steam workshop collection and upload the materials to the collection within the parent folder **`materials`**

###

### ▸Damage Blocking

Builder-X now completely blocks any type of damage (if enabled); so that a builder is safe from other players.

###

### ▸Save Loadouts

If a player is in PVP mode with weapons, tools, etc, and they decide to switch to Build mode; Builder-X will store a list of the player's PVP loadout; which will be given back to them when they return to PVP mode later.

###

### ▸Punishments

Builder-X by default has numerous methods for restricting damage to another player. However; not all SWEPs / weapons are created equal. In the event that a weapon is developed in an odd manner that can actually do damage to a player by causing indirect player-to-player damage; a punishments system has been implemented.

The system is able to track down the owner of the swep causing the damage and kick them if they exceed the damage threshold limits.&#x20;

**Damage can be tracked by:**

* **Kills** (limit 3)
* **Damage** (limit 500hp)

Once the above threshold has been reached; a player will be kicked from the server (if enabled).

![](/files/-MSsutoLq4FxJa5uWZjF)

###

### ▸Item Restrictions

Script now has numerous layers of restrictions that can be put into place. This includes restricted spawning and picking up items. If these restrictions are enabled; players will be completely stopped from picking up anything laying on the ground or from spawning items from the Context menu unless it is props.

Builder-X's config files allow server admins to whitelist items so that player's will be allowed to spawn additional items aside from the stock restrictions that are included with the script.

###

### ▸Usergroup Immunity

If you have staff or certain usergroups which need to bypass the restrictions made by Builder-X; you may add those usergroups to the script's build mode whitelist. This allows players in a specified group to bypass cooldowns, spawning, picking up, etc.

{% tabs %}
{% tab title="Lua\modules\builderx\cfg\sh\_cfg\_modes\_build.lua" %}

```lua
cfg.build.restrict.bypass =
{
    [ 'owner' ] 	        = true,
    [ 'superadmin' ] 	    = true,
    [ 'admin' ] 	        = false,
    [ 'operator' ]        = false,
    [ 'donator' ]         = false,
    [ 'user' ]            = false
}
```

{% endtab %}
{% endtabs %}

Add your own usergroups to the list if you wish to give them immunity. and then set **false** to **true**. Any usergroup added but set to **false** will have NO immunity until set back to true.

### ▸Notifications

Players will now see notifications based on any restrictions or actions made by a player where Builder-X needs to intervene.&#x20;

![](/files/-MSrjSmDbp6B89_ckze4)

###

### ▸Switching Cooldown

To prevent abuse; Builder-X has two types of cooldowns:

1. If the player has been damaged; they must wait before they can switch from PVP to Build mode *(default **20** seconds)*.
2. If the player has switched from one mode to the other; they must wait before they can switch modes again *(default **10** seconds)*.

###

### ▸Developer Hooks

The new rewrite includes a set of hooks which can be used by server owners to write special functions for their server. You can view a list of [**Developer Hooks here**](/developers/hooks).

###

### ▸Pointshop 2 : Airdrops DLC

Servers running the **Airdrops DLC** for **Pointshop 2**; can now restrict airdrops from being picked up while the player is in Build Mode.

####

### ◾ Updated ServerGuard permissions

ServerGuard permissions are now more easily identifiable with new names.


# FAQ

Answers to common questions and troubleshooting steps.

### ▸[Addon Won't Show](/faq/addon-wont-show)

&#x20;   Instructions for handling situations where the addon will not \
&#x20;   display at all on the server.

####

### ▸[Incompatible Addons](/faq/incompatible-addons)

&#x20;    View a list of Workshop Addons that are deemed incompatible \
&#x20;    with this addon.

####

### ▸[Damage Issues](/faq/damage-issues)

&#x20;   If players are still receiving damage despite being in Build Mode.

####

### ▸[Modified Script](/faq/modified-script)

&#x20;   The answer you will receive if you wrote your own customizations\
&#x20;   which are not working.

####

### ▸[Refunds](/faq/refunds)

&#x20;   Policy regarding refunds

####

### ▸[Script Errors](/faq/script-errors)

&#x20;   Instructions for handling situations where the addon throws\
&#x20;   errors in the server console.

####

### ▸[When Are Updates?](/faq/when-are-updates)

&#x20;   The main question I always get asked.


# Addon Won't Show

Steps to take if your addon will not display in-game.

## ▸Verify Install

Verify that you've followed the instructions on the [**Install**](/setup/install) page. Ensure that this includes both a good installation of rlib AND the addon itself. You can also follow the steps on the [**Verify**](/setup/verify) page to ensure that both of these are functioning properly.

## ▸Revert Config Changes

If you have made changes to the configuration and cannot get the addon to show; revert those changes. Try installing a fresh copy of the addon without any changes to determine if the changes to the config are to blame or if you are having issues elsewhere.

## ▸Use Latest Versions

Ensure that you are using the latest version of both rlib AND the addon you are trying to install. [**Gmodstore**](https://gmodstore.com) allows developers to post multiple versions of an addon, and sometimes customers can accidentally click if downloading the addon from the Versions tab. Double-check your installed version.

## ▸Check For Incompatible Addons

If you are experiencing issues with this addon; ensure first that it is not conflicting with other addons. Any addons that have been installed from the Steam Workshop **MUST** be checked first. This developer cannot control the quality of code for addons distributed via the Steam Workshop and most reported situations involve a Workshop addon that is not coded properly and has not been updated in years.

For more detailed instructions; view the [**Incompatible Addons**](/faq/incompatible-addons) page.


# Incompatible Addons

Addons in this list have been deemed "incompatible" and require extra work.

## ▸Official List

The following workshop addons have been known to cause issues with this script after being reported to the developer.  In order to get this addon functioning properly; please review the chart below to see what is causing the incompatibility.

Certain workshop addons are coded poorly, and the Steam Workshop does not have "Coding Standards". In order to correct the addons below; it would be required to modify the Workshop addon itself which is not good practice for us. We do not want to modify other scripts to behave differently than what you expect them to behave.

|                      |   |
| -------------------- | - |
| *No addons reported* |   |

## ▸Check Addons

From time to time; certain addons from the Steam Workshop may conflict with purchased addons from Gmodstore.

{% hint style="warning" %}
**Ensure you follow these instructions**. If you submit a ticket about the addon not showing up and it properly being installed; this will be the first process the developer makes you go through.
{% endhint %}

To eliminate the possibility of a Steam Workshop addon breaking this addon; please complete the following:

* **Open** your server's Hosting Control Panel (gmc, crident, etc).
* Locate the **Startup Parameters** section.
* **REMOVE** the steam workshop collection id associated to the server

![](/files/-MTk2NP2DSypG7Ju-mUR)

* **Save** your server settings with **workshop id removed**
* **Restart** the server and then join
* **Check** to see if the addon now works

If you removed the workshop collection and your addon **does NOT work**; Submit a Ticket to the developer.

If you removed the workshop collection and your addon **now works**; you will need to use [**Process of Elimination**](/faq/incompatible-addons#process-of-elimination) to figure out which addon is causing a conflict.

####

## ▸Process of Elimination

If you have verified that this addon does not function unless you remove your Steam Workshop Collection; then you will need to figure out which addon is causing conflicts. Again, this is usually not a developer issue related to addons on Gmodstore, but improperly coded addons that are provided on the workshop that have no quality control in place.

You will need create an additional Steam Workshop Collection titled something such as **Test**; and apply that new workshop id to your server; replacing your official collection.

Add a small group of addons to begin with (roughly five (5) at a time) to your new test collection, and then restart your server.&#x20;

When the server is back online, join the server and test this addon to see if it starts to function. If it does, you will need to narrow down which of the five newest addons may be causing the conflict by removing one of the five; one by one and doing a restart.

If the issue persists after five are added; then add an additional five and continue this process.

It is tedious, and takes time especially on servers which a large list of subscribed workshop items, but it is the only way to determine which addon is conflicting.

Once you find the conflicting addon; contact the developer of *this gmodstore addon* to see if some type of work-around can be developed.

{% hint style="info" %}
When adding workshop items to a test collection, start with workshop items that add major functionality. These are usually the ones that cause issues. Leave workshop items that simply add player or prop models and maps for last as these are less likely to be the issue.
{% endhint %}


# Damage Issues

If players are still receiving damage despite being in Build Mode.

99% of damage is blocked to players in Build Mode by default; however, if you notice players in Build Mode getting damaged by entities / props hitting them; there is one more line of defense:

* Open **lua\modules\builderx\cfg\sh\_cfg\_modes\_build.lua**
* Set **cfg.build.bAdvBlockDmg = true**

This will further increase a player's protection; but will render the "Punishment System" useless since a player can no longer take any type of damage (including fall damage). If you decide to turn this one, then you can also disable the punishment system since it is no longer needed.


# Modified Script

The answer you will receive if you wrote your own customizations which are not working.

If you modified this script and are now having issues getting your changes to function properly; this is an issue you will have to troubleshoot yourself.

I do not provide support for modifications to the base script.

This policy does **NOT** include changing settings that come out-of-box; which you will still receive support for.


# Refunds

Policy regarding refunds

It is common for customers to have basic issues with a script; immediately assume it is the script's fault, and request a refund before any type of communication or ticket has been created. Then after initial troubleshooting; it ends up being a bad installation, or a user-error.

For this reason is why refunds are not granted simply upon request if you report an issue with the script. The developer will request that you submit a ticket with the following information:

* Any errors in your server-side console
* Verifying your installation path
* Confirming the script works without any initial settings being modified

If the above points appear to be fine; then the developer is going to request additional information related to your server itself so that the developer can take a look personally.

Should bugs with the script be present; the developer will release updates addressing the issue.

Because you are dealing with digital items; a developer cannot remove your downloaded copy of an addon. *Therefore, a refund is approved in instances where no other possible solution can be provided to address your issue in a proper amount of time; as long as the issue is with the addon itself, and NOT because of user-errors.* Which will be determined by the developer after you create your initial support ticket.


# Script Errors

If your server console is throwing errors.

## ▸**Errors occur after you edited the config files?**

If yes; go back to the edited config file and remove the edits you have made and attempt to restart the server and check for errors.

## ▸**Errors occur with no edits?**

Make sure you followed the [**Install**](/setup/install) procedures properly.

## ▸**Errors occur with good install and no edits?**

Write down the error and contact the developer on [**gmodstore.com**](https://gmodstore.com)


# When Are Updates?

The number one question...

I cannot give ETAs on when updates are released. I am constantly working on adding new features, as well as bug fixes. On top of that, I have a large list of scripts that also still receive regular updates. If I give an ETA on an update release; I cannot stick to that schedule because something can arise that causes the update to be delayed; therefore, I'll never give a time / date of a release.


# Install

This section explains the installation process. Follow the instructions step-by-step.

## ▸Install rlib

* Go to [**https://get.rlib.io/**](https://get.rlib.io/) and download the latest version of **rlib**.&#x20;
* **Extract** the downloaded zip to your computer
* **Create** a new folder on your gmod server called **rlib**
  * *Example: garrysmod/addons/**rlib**/*
* **Upload** the extracted rlib zip files to the newly created folder.&#x20;
  * Ensure you are uploading the files to match the following file structure:

&#x20;                   📁 garrysmod\
&#x20;                       📁 addons\
&#x20;                           📁 **rlib**\
&#x20;                                📁 lua\
&#x20;                                📁 materials\
&#x20;                                📁 resource

* **Restart** the server
* As the server restarts, **view** the console **for errors**.&#x20;
  * If you see errors, contact the developer with a list of them.
  * If you do not see errors, proceed forward
* **Connect** to your gmod server and spawn in.&#x20;
* Make sure you have **superadmin** access on the server. If you are using an admin mod; do one of the following sub-points below:
  * **ULX:** In server console; type `ulx adduser yourname superadmin`
  * **SAM:** In server console; type `sam giverank yourname superadmin`
  * **SGUARD:** In server console; type `serverguard_setrank yourname superadmin`
* Once you have superadmin; type **`?setup`** in chat.
* You have completed the setup. Proceed to the [**Install Addon**](/setup/install#install-addon) section below.

###

## ▸Install addon

* Go to [**https://gmodstore.com/**](https://gmodstore.com/) and download a fresh copy of your purchased script.
* **Extract** the download zip to your computer
* **Create** a new folder on your gmod server called the name of the addon
  * Make sure the folder name contains **NO SPACES**, **NO SPECIAL CHARACTERS**, and **NO CAPS**
  * *Example:  garrysmod/addons/**builderx***
* **Upload** the extracted addon files to the newly created folder
  * Ensure you are uploading the files to match the following file structure:

&#x20;                   📁 garrysmod\
&#x20;                       📁 addons\
&#x20;                           📁 **builderx**\
&#x20;                                📁 lua\
&#x20;                                📁 materials\
&#x20;                                📁 resource

* **Restart** the server
* As the server restarts, **view** the console **for errors**.&#x20;
  * If you see errors, view [**Script Throwing Errors**](/faq/script-errors)
  * If you do not see errors, proceed forward
* Try to activate your addon.
  * View [**Binds**](/first-use/binds) page for list of methods available for this script.
* If you see the script actively working, then you are finished with the setup.

###

### ▸What's Next?

Want to subscribe to this addon's **steam workshop collection**? Visit the [**Workshop**](/setup/workshop) page.

Curious about the ***/docs/web*** folder provided in your zip? Visit the [**Web**](/setup/docs-web) part of this guide.


# Verify

Confirm your installation with the following instructions.

## ◾ Verify rlib

* Once installation is complete; connect to your Garry's Mod server.
* Open the console ( \~ )
* Execute the command:

{% tabs %}
{% tab title="Console" %}

```
rlib.version
```

{% endtab %}
{% endtabs %}

The following should output:

{% tabs %}
{% tab title="Console" %}

```
rlib Manifest: 
       Ver :  v3.2.0-stable  ( 12.06.2020 )
       Dev :  Richard
       Doc :  https://docs.rlib.io/ 
```

{% endtab %}
{% endtabs %}

####

## ◾ Verify addon

### ▸Method 1 (Console)

To verify if your addon is installed properly:

* Connect to your Garry's Mod server
* Open the console ( \~ )
* Execute the command:

{% tabs %}
{% tab title="Console" %}

```
rlib.running
```

{% endtab %}
{% endtabs %}

The following should output:

{% tabs %}
{% tab title="Console" %}

```
[CONSOLE] [rlib] nodules » builder-x, workshop
```

{% endtab %}
{% endtabs %}

You can also execute the following command in the server-side console:

{% tabs %}
{% tab title="Console" %}

```
rlib.modules
```

{% endtab %}
{% endtabs %}

This command should show something such as the following:

![](/files/-MSrmRiwfgLQNymyMPxW)

####

### ▸Method 2 (In-game)

Any addon that includes an interface will come with multiple ways to make it appear on-screen. Obviously, by making the interface appear, you will know that it is successfully installed.

For a list of activation methods, view the [**Binds**](/first-use/binds) page.


# Workshop

Workshop collection info related to this addon

Each addon has a workshop collection associated to it. The workshop content delivers materials, fonts, and sounds to your users so that they'll be able to see everything within the addon.

These scripts include a workshop auto-mounting system which will force each connecting player to mount the required workshop for this addon; however, if you need the workshop for other purposes or to add to your server's workshop collection; you can get it below:

[![Download\]](https://img.shields.io/badge/download-here-red.svg)](https://steamcommunity.com/sharedfiles/filedetails/?id=2389304871) ![Downloads](https://img.shields.io/steam/downloads/2389304871.svg?color=blue\&logo=steam) ![Subscriptions](https://img.shields.io/steam/subscriptions/2389304871.svg?color=%23DF54AF) ![Size](https://img.shields.io/steam/size/2389304871.svg)


# Docs/Web

This information explains the 'web' folder provided in your downloaded zip.

## ▸Summary

This script includes wallpapers / live backgrounds which can be displayed on your interface. These wallpapers are hosted via **rlib's cloud**, which should only be temporary.

Your downloaded zip from [**gmodstore.com**](https://gmodstore.com) includes a **`docs/web`** folder which contains a series of static images and a live wallpaper .webm file that you can use as wallpaper to display on your in-game interface.

It is recommended that you utilize your own hosting server and upload the files provided in the **`docs/web`**&#x66;older. If the rlib cloud goes down; your wallpapers will not work.

You may also upload the images to a website such as [**https://imgur.com/**](https://imgur.com/) and use the link they provide after upload within your config to change wallpaper URLs.

####

## ▸Static Wallpapers

Static wallpapers are still images located in the **`docs/web/static`** folder. This folder includes a few demo wallpapers to get you started, however, you can use any images you'd like.

{% hint style="info" %}
Creating your own? We recommend you use an image size of **1920x1080** **minimum**.
{% endhint %}

####

## ▸Live Wallpapers

Live wallpapers are animated videos that are in **.webm** format. One is provided for you as an example, as well as a .php script which allows you to implement them in your script.

####

## ▸Upload / Webserver

* Upload the contents of the docs/web folder to your own hosting server.
* Open your script's background config file.
  * **`lua\modules\builderx\cfg\sh_cfg_bg.lua`**
* Locate the two tables associated with static and live wallpaper URLs.
  * **`cfg.bg.static.list`** and **`cfg.bg.live.list`**
* Edit the URLs to match your own webserver URL.
  * For static images; it is simply the path to your image:
    * *<https://yourdomain.com/web/static/1.jpg>*
  * For live wallpapers; use the .php file provided and add the video name:
    * *<http://yourdomain.com/web/live/index.php?id=default\\_1>*
* If you change the names of the files; then edit the paths accordingly.
* Once edited; save the config, and restart the server.

####

## ▸Upload / Imgur

[**https://imgur.com/**](https://imgur.com/) can be used for static wallpapers only. You will need to use your own personal webserver to host live wallpapers.

* Create an account on imgur.com
* Select **Add Images** and use the upload interface to select your static wallpapers and upload them.
* Once uploaded; select the photo and a popup will appear with a series of links on the right.
* Copy the **Direct Link** url
* Open your script's background config file.
  * **`lua\modules\builderx\cfg\sh_cfg_bg.lua`**
* Locate the static table URLs:
  * **`cfg.bg.static.list`**
* Edit the URLs to match your imgur direct URL.
  * *<https://i.imgur.com/yourimage.png>*
* Once edited; save the config, and restart the server.

![](/files/-MSrdU93nfGPkp5adMYv)


# Env

Library environment file.

The environment (env) file tells the library (rlib) how it should be loaded, and what needs to be done in order for the addon to work properly. Settings in this file should *only* be modified if the person knows exactly what they are doing; or by the developer.

You will not be given support if you modify this file. The only changes a server owner should make are the options described below.

## ▸Location

&#x20;   **`lua\modules\builderx\sh_env.lua`**

## ▸Settings

| Setting                | Desc                                                                                                                                                |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| **MODULE.enabled**     | Allows you to disable the addon without the need to move the addon's parent folder out of the server's addon folder.                                |
| **MODULE.ws\_enabled** | If false; workshop collection for the addon will not be forced to the player when they connect.                                                     |
| **MODULE.ws\_lst**     | Workshop collection to force on players if **MODULE.ws\_enabled** is true.                                                                          |
| **MODULE.mats**        | List of materials used with the addon. You may add your own, however, the server must be restarted after adding new entries before they are usable. |


# Fonts

Information related to modifying fonts.

## ▸ Location

&#x20;     **`lua\modules\builderx\core\cl_fonts.lua`**

## ▸ Parameters

&#x20;     ***`str`**`    ``prefix`*\
&#x20;                         prefix added to front of **id\_name** string

&#x20;     ***`str`**`    ``id_name`*\
&#x20;                         name used to call font entry

&#x20;     ***`str`**`    ``font`*\
&#x20;                         name of font used

&#x20;    ***`int`**`     ``size`*\
&#x20;                          size for font

&#x20;    ***`int`**`     ``weight`*\
&#x20;                          font weight ( *`100, 200, 300, 400, 500, 600, 700, 800`* )

&#x20;    ***`bool`**`    ``shadow`*\
&#x20;                          add shadow casting to the font

&#x20;    ***`bool`**`    ``extended`*\
&#x20;                          allow font to display glyphs outside Latin-1 range. \
&#x20;                          unicode code points above 0xFFFF are not supported.

&#x20;    ***`bool`**`    ``symbol`*\
&#x20;                          enables the use of symbolic fonts such as Webdings

## ▸ Structure

Each font has the following structure:

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

```lua
_f( prefix, 'id_name', 'Font Name', size, weight, shadow, extended, sym )
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="lua\modules\builderx\core\cl\_fonts.lua" %}

```lua
_f( pf, 'root_exit', 'Roboto Light', 44, 800 )
```

{% endtab %}
{% endtabs %}

## ▸ Saving Changes

After changing a font; you must execute the console command\
&#x20;     **`builderx.fonts.reload`**

## ▸ Notes

The only values you should modify are the **font name**, **size**, **weight**, and **shadow**.

If you wish to use a **custom font** that is not included with Garry's Mod; you must provide that font in a Steam Workshop collection for your server; or sync it to players using FastDL. This documentation does not include instructions on doing that; as it's outside the scope of what the purpose of this documentation is for.


# Languages

This section explains how to add your own language

## ▸Location

All languages included with script are located in **`lua\modules\builderx\lang`**

## ▸Add Language

* Copy the **lua\modules\builderx\lang\en.lua** file
* Rename copied en.lua file to your own language
  * Example: **lua\modules\builderx\lang\ru.lua** ( russian )
* Open the new language file in a text editor.
* Locate the line:&#x20;
  * `mod.language[ 'en' ]`
* Change the line to your new language:&#x20;
  * `mod.language[ 'ru' ]`
* Translate all of the strings to your own language.

## ▸Set Default Language

* Open the folder **lua\modules\builderx\lang\\**
* Find the filename for the language you want to make as your default
* Open **lua\modules\builderx\cfg\sh\_cfg.lua**
* Locate the setting **cfg.lang**
* Change **'en'** to your own language's filename (without the .lua at the end)

```lua
cfg.lang = 'ru' -- russian
cfg.lang = 'es' -- spanish
cfg.lang = 'fr' -- french
```

* Restart your server if changes do not get applied immediately.

## ▸Switching Languages

You can switch languages in-game on-the-fly by typing **`!lang`** in chat.

![](/files/-MSszVcThUcURDDBeU9c)

{% hint style="warning" %}
The languages in the list are a compiled set from all the addons you own running rlib. If you own multiple scripts, but only have French translations for one; then the one addon will be translated to French and the others will default to English.
{% endhint %}


# Settings

Explains configuration options, paths, and general settings information

Settings files contain a wide variety of values that can be changed and deal with how the overall addon will look and perform. These files are typically where you will turn certain addon features on/off, change feature settings, modify the colors for any user-interface provided, etc.

## ▸Location

**`lua\modules\builderx\cfg\*`**

## ▸Files

| File                      | Description                                   |
| ------------------------- | --------------------------------------------- |
| **sh\_cfg\_bg**           | Static & live wallpapers                      |
| **sh\_cfg\_binds**        | Methods for opening / activating interface    |
| **sh\_cfg\_dev**          | Developer only settings                       |
| **sh\_cfg\_general**      | General settings                              |
| **sh\_cfg\_modes**        | List of modes available for players to select |
| **sh\_cfg\_modes\_build** | Build mode specific settings                  |
| **sh\_cfg\_modes\_pvp**   | PVP mode specific settings                    |


# ▸sh\_cfg\_bg

Static & live wallpaper management

### ◾ cfg.bg.static.enabled

{% tabs %}
{% tab title="Description" %}
if enabled; interface will display a static background behind all other elements of the script.
{% endtab %}

{% tab title="Default" %}

```lua
cfg.bg.static.enabled = false
```

{% endtab %}
{% endtabs %}

####

### ◾ cfg.bg.static.list

{% tabs %}
{% tab title="Description" %}
Stores a list of URLs which will be used to display a static wallpaper within the interface.

**`Requires:`**` ``cfg.bg.static.enabled = true`
{% endtab %}

{% tab title="Default" %}

```lua
cfg.bg.static.list =
{
    'http://cdn.rlib.io/wp/s/1.jpg',
    'http://cdn.rlib.io/wp/s/2.jpg',
    'http://cdn.rlib.io/wp/s/3.jpg',
    'http://cdn.rlib.io/wp/s/4.jpg',
    'http://cdn.rlib.io/wp/s/5.jpg',
    'http://cdn.rlib.io/wp/s/6.jpg',
    'http://cdn.rlib.io/wp/s/7.jpg',
    'http://cdn.rlib.io/wp/s/8.jpg',
    'http://cdn.rlib.io/wp/s/9.jpg',
}
```

{% endtab %}
{% endtabs %}

####

### ◾ cfg.bg.live.enabled

{% tabs %}
{% tab title="Description" %}
If enabled; interface will display live wallpapers (animated).
{% endtab %}

{% tab title="Default" %}

```lua
cfg.bg.static.enabled = false
```

{% endtab %}
{% endtabs %}

####

### ◾ cfg.bg.live.list

{% tabs %}
{% tab title="Description" %}
Stores a list of URLs which will be used to display an animated wallpaper within the interface.

**`Requires:`**` ``cfg.bg.live.enabled = true`
{% endtab %}

{% tab title="Default" %}

```lua
cfg.bg.live.list =
{
    'http://cdn.rlib.io/wp/l/index.php?id=default_1',
    'http://cdn.rlib.io/wp/l/index.php?id=default_2',
    'http://cdn.rlib.io/wp/l/index.php?id=default_3',
    'http://cdn.rlib.io/wp/l/index.php?id=default_4',
    'http://cdn.rlib.io/wp/l/index.php?id=default_5',
    'http://cdn.rlib.io/wp/l/index.php?id=default_6',
    'http://cdn.rlib.io/wp/l/index.php?id=default_7',
    'http://cdn.rlib.io/wp/l/index.php?id=default_8',
    'http://cdn.rlib.io/wp/l/index.php?id=default_9',
    'http://cdn.rlib.io/wp/l/index.php?id=default_10',
    'http://cdn.rlib.io/wp/l/index.php?id=default_11',
}
```

{% endtab %}

{% tab title="Notes" %}
Live wallpapers take priority over static wallpapers. If you have both static and live wallpapers enabled; then live wallpapers will be displayed.
{% endtab %}
{% endtabs %}

####

### ◾ cfg.bg.filter

{% tabs %}
{% tab title="Description" %}
Series of settings related to the filter for backgrounds.

These will make the background blurred, darker / lighter, etc.
{% endtab %}

{% tab title="Settings" %}

```lua
cfg.bg.filter.enabled       = true
cfg.bg.filter.clr           = Color( 0, 0, 0, 25 )
cfg.bg.filter.blur          = false
cfg.bg.filter.blur_power    = 3
```

{% endtab %}
{% endtabs %}


# Binds

Information related to interacting with the addon.

## ▸General

Basic functionality binds used to open the main interface or utilize general functionality.

| **Type**  | **Bind**       | **Desc**                 |
| --------- | -------------- | ------------------------ |
| *Chat*    | **`!mode`**    | Mode selection interface |
| *Chat*    | **`!pvp`**     | enable PVP mode          |
| *Chat*    | **`!build`**   | enable Build mode        |
| *Chat*    | **`!fly`**     | enable / disable noclip  |
| *Key*     | **`F8`**       | Mode selection interface |
| *Console* | **`builderx`** | Mode selection interface |


# Functions

Functions for interacting with this addon

{% hint style="warning" %}
These items are provided as additional helpful notes about this addon. Support will not be provided for issues related to modifications made to the addon.
{% endhint %}

| Functions                                                | Desc                                   | Scope |
| -------------------------------------------------------- | -------------------------------------- | ----- |
| ▸ [**pl:GetBuild( )**](/developers/functions/getbuild)   | returns true of player in build mode   | 🟦    |
| ▸ [**pl:SetBuild( b )**](/developers/functions/setbuild) | sets build state on player             | 🟦    |
| ▸ [**pl:GetDmg( )**](/developers/functions/getdmg)       | returns damage done by player in build | 🟦    |
| ▸ [**pl:SetDmg( i )**](/developers/functions/setdmg)     | sets total damage done by player       | 🟦    |
| ▸ [**pl:AddDmg( i )**](/developers/functions/adddmg)     | adds damage to current damage          | 🟦    |


# GetBuild

𝗦𝗛𝗔𝗥𝗘𝗗

`pl:GetBuild( )`

## ▸ Parameters

&#x20;      None

## ▸ Description

&#x20;        Returns player's build state\
&#x20;                **true**   : player in build mode\
&#x20;                **false** : player in pvp mode

## ▸ Example

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

```lua
local function check_build( pl )

    local bBuild = pl:GetBuild( )
    
    if bBuild then
        print( 'player in build mode' )
    else
        print( 'player in pvp mode' )
    end
    
end
```

{% endtab %}
{% endtabs %}


# ��  SetBuild

𝗦𝗛𝗔𝗥𝗘𝗗

`pl:SetBuild(` [**ᵇᵒᵒˡ**](https://wiki.facepunch.com/gmod/boolean)  state`)`

## ▸ Parameters

&#x20;     ***`bool`**`  ``state`*\
&#x20;                       sets whether player in build mode or not

## ▸ Description

&#x20;        Sets a player's current build mode state.

## ▸ Example

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

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

{% endtab %}
{% endtabs %}


# GetDmg

𝗦𝗛𝗔𝗥𝗘𝗗

`pl:GetDmg( )`

## ▸ Parameters

&#x20;      None

## ▸ Description

&#x20;        Returns a player's current damage count as integer


# 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 %}


# AddDmg

𝗦𝗛𝗔𝗥𝗘𝗗

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

## ▸ Parameters

&#x20;     ***`int`**`    ``damage`*\
&#x20;                         amount of damage to add to existing amount

## ▸ Description

&#x20;        Adds damage to 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 punish_pl_hurt( pl, attk, hp, dmg )
    attk:AddDmg( dmg )
end
rhook.new.gmod( 'PlayerHurt', 'builderx_sv_punish_pl_hurt', punish_pl_hurt )
```

{% endtab %}
{% endtabs %}


# Hooks

List of hooks available for this script

{% hint style="warning" %}
These items are provided as additional helpful notes about this addon. Support will not be provided for issues related to modifications made to the addon.
{% endhint %}

| Hook Name                                                                | Desc                                        |
| ------------------------------------------------------------------------ | ------------------------------------------- |
| ▸ [**builderx.mode.onswitch**](/developers/hooks/builderx_mode_onswitch) | player switches modes                       |
| ▸ [**builderx.pl.ondamage**](/developers/hooks/builderx_pl_ondamage)     | player in build mode damages another player |
| ▸ [**builderx.pl.onjoin**](/developers/hooks/builderx_pl_onjoin)         | player joins server after PVP mode enabled  |
| ▸ [**builderx.pl.onnoclip**](/developers/hooks/builderx_pl_onnoclip)     | player enters/exits noclip                  |


# builderx.mode.onswitch

🟥 𝗦𝗘𝗥𝗩𝗘𝗥

`builderx.mode.onswitch(` [**ᵖˡᵃʸᵉʳ**](https://wiki.facepunch.com/gmod/Player) pl,   [**ᵇᵒᵒˡ**](https://wiki.facepunch.com/gmod/boolean) bIsBuild,   [**ᵇᵒᵒˡ**](https://wiki.facepunch.com/gmod/boolean) bIsForced,   [**ᵇᵒᵒˡ**](https://wiki.facepunch.com/gmod/boolean) bHalo,   [**ᵇᵒᵒˡ**](https://wiki.facepunch.com/gmod/boolean) bHud`)`

## ▸ Parameters

&#x20;     ***`ply`**`    ``pl`*\
&#x20;                         player object

&#x20;     ***`bool`**`   ``bIsBuild`*\
&#x20;                         returns **true** if player switching to **build mode**; false for pvp mode

&#x20;     ***`bool`**`   ``bIsForced`*\
&#x20;                         returns **true** if player forced to switch by admin command (ulx, sam, etc)

&#x20;    ***`bool`**`   ``bHalo`*\
&#x20;                         returns **true** if halo enabled on player

&#x20;    ***`bool`**`   ``bHud`*\
&#x20;                         returns **true** if player has head hud enabled

## ▸ Description

&#x20;      Runs when player switches modes

## ▸ Example

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

```lua
local function your_hook( pl, bIsBuild, bIsForced, bHalo, bHud )

    // your custom hook function here

end
hook.Add( 'builderx.mode.onswitch', 'your_hook_id', your_hook )
```

{% endtab %}

{% tab title="Example 2" %}

```lua
hook.Add( 'builderx.mode.onswitch', 'your_hook_id', function( pl, bIsBuild, bIsForced, bHalo, bHud )

    // your custom hook function here

end )
```

{% endtab %}

{% tab title="Example 3" %}

```lua
local function your_hook( pl, bIsBuild, bIsForced, bHalo, bHud )

    // your custom hook function here

end
rhook.new.rlib( 'builderx_mode_onswitch', your_hook )
```

{% endtab %}
{% endtabs %}


# builderx.pl.ondamage

🟥 𝗦𝗘𝗥𝗩𝗘𝗥

`builderx.pl.ondamage(` [**ᵖˡᵃʸᵉʳ**](https://wiki.facepunch.com/gmod/Player) attacker,   [**ᵖˡᵃʸᵉʳ**](https://wiki.facepunch.com/gmod/Player) victim,   [**ⁿᵘᵐᵇᵉʳ**](https://wiki.facepunch.com/gmod/number) damage`)`

## ▸ Parameters

&#x20;     ***`ply`**`    ``attacker`*\
&#x20;                         player object (player doing damage)

&#x20;     ***`ply`**`    ``victim`*\
&#x20;                         player object (player injured)

&#x20;     ***`int`**`    ``damage`*\
&#x20;                         returns total damage attacker has done in build mode

## ▸ Description

&#x20;      Runs when player in build mode deals damage to another player (or kills).

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

## ▸ Example

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

```lua
local function your_hook( attacker, victim, damage )

    // your custom hook function here

end
hook.Add( 'builderx.pl.ondamage', 'your_hook_id', your_hook )
```

{% endtab %}

{% tab title="Example 2" %}

```lua
hook.Add( 'builderx.pl.ondamage', 'your_hook_id', function( attacker, victim, damage )

    // your custom hook function here

end )
```

{% endtab %}

{% tab title="Example 3" %}

```lua
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
```

{% endtab %}

{% tab title="Example 4" %}

```lua
local function your_hook( attacker, victim, damage )

    // your custom hook function here

end
rhook.new.rlib( 'builderx_mode_ondamage', your_hook )
```

{% endtab %}
{% endtabs %}


# builderx.pl.onjoin

🟥 𝗦𝗘𝗥𝗩𝗘𝗥

`builderx.mode.onswitch(` [**ᵖˡᵃʸᵉʳ**](https://wiki.facepunch.com/gmod/Player) pl`)`

## ▸ Parameters

&#x20;     ***`ply`**`    ``pl`*\
&#x20;                         player object

## ▸ Description

&#x20;      Runs when player joins server and is initially setup with builderx to be in pvp mode

## ▸ Example

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

```lua
local function your_hook( pl )

    // your custom hook function here

end
hook.Add( 'builderx.pl.onjoin', 'your_hook_id', your_hook )
```

{% endtab %}

{% tab title="Example 2" %}

```lua
hook.Add( 'builderx.pl.onjoin', 'your_hook_id', function( pl )

    // your custom hook function here

end )
```

{% endtab %}

{% tab title="Example 3" %}

```lua
local function your_hook( pl )

    // your custom hook function here

end
rhook.new.rlib( 'builderx_mode_onjoin', your_hook )
```

{% endtab %}
{% endtabs %}


# builderx.pl.onnoclip

🟥 𝗦𝗘𝗥𝗩𝗘𝗥

`builderx.pl.onnoclip(` [**ᵖˡᵃʸᵉʳ**](https://wiki.facepunch.com/gmod/Player) pl`)`

## ▸ Parameters

&#x20;     ***`ply`**`    ``pl`*\
&#x20;                         player object

&#x20;     ***`bool`**`   ``state`*\
&#x20;                         returns **true** if player enters noclip mode; **false** if noclip taken away

## ▸ Description

&#x20;      Runs when a player uses the noclip chat command (!fly) to enter / exit noclip in build mode.

## ▸ Notes

&#x20;        Will **NOT** be called if player uses an outside method to enter noclip such as:\
&#x20;             ulx noclip, darkrp fly mode, etc.

## ▸ Example

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

```lua
local function your_hook( pl, state )

    // your custom hook function here

end
hook.Add( 'builderx.pl.onnoclip', 'your_hook_id', your_hook )
```

{% endtab %}

{% tab title="Example 2" %}

```lua
hook.Add( 'builderx.pl.onnoclip', 'your_hook_id', function( pl, state )

    // your custom hook function here

end )
```

{% endtab %}

{% tab title="Example 3" %}

```lua
local function your_hook( pl, state )

    // your custom hook function here

end
rhook.new.rlib( 'builderx_mode_onnoclip', your_hook )
```

{% endtab %}
{% endtabs %}


