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