# Usage

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

{% code title="Server Script" %}

```lua
local Notif = require(game.ReplicatedStorage.NS_Notification.Notification)
local Icons = require(game.ReplicatedStorage.NS_Notification.IconPresets)

Notif:newServer(color, icon, duration, title, msg)
```

{% endcode %}

{% hint style="info" %}
This is for sending notifications to the server (all clients in-game).
{% endhint %}

### :newClient()

{% code title="Server Script" %}

```lua
local Notif = require(game.ReplicatedStorage.NS_Notification.Notification)
local Icons = require(game.ReplicatedStorage.NS_Notification.IconPresets)

Notif:newClient(target, color, icon, duration, title, msg)
```

{% endcode %}

{% hint style="info" %}
This is for sending notifications to specific clients in-game.
{% endhint %}

### Example

{% code title="Server Announcement - Server Script" %}

```lua
local Notif = require(game.ReplicatedStorage.NS_Notification.Creator)
local Icons = require(game.ReplicatedStorage.NS_Notification.IconPresets)
Notif:newServer(Color3.fromRGB(60, 149, 41), Icons.Bullhorn, 10, "Announcement", "Thanks for checking out the Notification System!")
```

{% endcode %}

{% code title="Player Joined - Server Script" %}

```lua
local Notif = require(game.ReplicatedStorage.NS_Notification.Notification)
local Icons = require(game.ReplicatedStorage.NS_Notification.IconPresets)

game.Players.PlayerAdded:Connect(fucntion(plr)
    plr.CharacterAdded:Wait()
    Notif:newClient(plr, Color3.fromRGB(18, 150, 64), Icons.Notification, 10, "Welcome!", "Welcome to the game! Enjoy your time here!"
end)
```

{% endcode %}


---

# 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://nikko-1.gitbook.io/docs/notification-system/usage.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.
