> For the complete documentation index, see [llms.txt](https://nikko-1.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nikko-1.gitbook.io/docs/overhead-ui/usage.md).

# Usage

{% hint style="warning" %}
**Note:** Everything must be done from the Server, through ServerScriptService
{% endhint %}

### **:Init()** <a href="#newserver" id="newserver"></a>

{% code title="Server Script" %}

```lua
local Overhead = require(game.ReplicatedStorage:WaitForChild("NSOverhead"))
Overhead:Init()
```

{% endcode %}

{% hint style="info" %}
This is required in order to initialize the Overhead UI Module.
{% endhint %}

### :GiveOverhead(args)

{% code title="Server Script" %}

```lua
local Overhead = require(game.ReplicatedStorage:WaitForChild("NSOverhead"))
Overhead:Init()

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function()
        local args = {}
        args.Plr = plr
        args.PlrColor = Color3.fromRGB(255, 255, 255)
        args.Rank = " My Rank"
        args.RankColor = Color3.fromRGB(165, 58, 58)
        args.SpecialRankEnabled = true
        args.SpecialRank = "My Special Tag"
        args.SpecialRankColor = Color3.fromRGB(194, 33, 116)
        args.BadgesEnabled = true
        Overhead:GiveOverhead(args)
    end)
end)
```

{% endcode %}

{% hint style="info" %}
This creates the base of the Overhead UI. \
This will give the player the UI whenever their character spawns in.
{% endhint %}

### :GiveBadge(plr, badgeName, badgeId)

{% code title="Server Script" %}

```lua
local Overhead = require(game.ReplicatedStorage:WaitForChild("NSOverhead"))
Overhead:Init()

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function()
        local args = {}
        args.Plr = plr
        args.PlrColor = Color3.fromRGB(255, 255, 255)
        args.Rank = " My Rank"
        args.RankColor = Color3.fromRGB(165, 58, 58)
        args.SpecialRankEnabled = true
        args.SpecialRank = "My Special Tag"
        args.SpecialRankColor = Color3.fromRGB(194, 33, 116)
        args.BadgesEnabled = true
        Overhead:GiveOverhead(args)
        Overhead:GiveBadge(plr, "Developer", "http://www.roblox.com/asset/?id=6034275725")
    end)
end)
```

{% endcode %}

{% hint style="info" %}
This will give the player a "badge" or an overhead icon.

Plr is the player instance.

badgeName is the name the badge will be given.

badgeId is the image id of the badge.
{% endhint %}

### :RemoveBadge(plr, badgeName)

{% code title="Server Script" %}

```lua
local Overhead = require(game.ReplicatedStorage:WaitForChild("NSOverhead"))
Overhead:RemoveBadge(plr, "Developer")
-- plr is the Player Instance and "Developer" is the badge name that was assigned.
```

{% endcode %}

### :SetName(plr, name, nameColor)

{% code title="Server Script" %}

```lua
local Overhead = require(game.ReplicatedStorage:WaitForChild("NSOverhead"))
Overhead:SetName(plr, "Some Name", Color3.fromRGB(255,255,255))
```

{% endcode %}

### :SetRank(plr, rank, rankColor)

{% code title="Server Script" %}

```lua
local Overhead = require(game.ReplicatedStorage:WaitForChild("NSOverhead"))
Overhead:SetRank(plr, "Some Rank", Color3.fromRGB(255,255,255))
```

{% endcode %}

### :SetSpecialRank(plr, rank, rankColor)

{% code title="Server Script" %}

```lua
local Overhead = require(game.ReplicatedStorage:WaitForChild("NSOverhead"))
Overhead:SetSpecialRank(plr, "Some Special Rank", Color3.fromRGB(255,255,255))
```

{% endcode %}

{% hint style="danger" %}
The `:Set` will only work if they player already has an OverheadUI, if not it will not work.
{% endhint %}
