Tutorial · Menus, HUD and sound

How to make a notification system in Roblox Studio

Notifications are the small boxes that pop up in a corner: "You found 50 coins", "Round starting in 10 seconds", "Not enough gems". Most of them start on the server, because the server is what knows a purchase failed or a round began. This guide builds one system for all of them: a ModuleScript any server script can call in one line, and a LocalScript that shows each message as a toast, keeps a queue when many arrive at once, and slides them away after a few seconds.

Updated 14 November 20267 min readBeginnerLuauWritten by

In short

Put a RemoteEvent named Notify in ReplicatedStorage. On the server, call Notify:FireClient(player, text, kind) for one player or Notify:FireAllClients(text, kind) for everyone. In a LocalScript in StarterPlayerScripts, listen to Notify.OnClientEvent, make a small frame with the text inside a ScreenGui, tween it in, and remove it after about 4 seconds. Keep a queue so only a few show at once.

  • Wrap the RemoteEvent in a ModuleScript, so every server script sends notifications with Notifications.send(player, "text").
  • Set the ScreenGui's ResetOnSpawn to false, or toasts vanish when the player respawns.
  • For a quick message with no custom look, StarterGui:SetCore("SendNotification", ...) shows Roblox's own pop-up from a LocalScript.

Get the script

Notification toast script (client)

A LocalScript in StarterPlayerScripts that shows each notification from the server as a coloured toast, queues extras and slides them away.

LocalScript in StarterPlayerScripts named NotificationClient
-- LocalScript in StarterPlayerScripts named NotificationClient.
-- Shows each notice from the server as a toast in the top right, with a queue.
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")

local DURATION = 4 -- seconds each toast stays
local MAX_VISIBLE = 4 -- toasts on screen at once; the rest wait in a queue
local TOAST_WIDTH = 300
local TOAST_HEIGHT = 56

local COLORS: { [string]: Color3 } = {
	info = Color3.fromRGB(90, 150, 255),
	success = Color3.fromRGB(70, 205, 125),
	error = Color3.fromRGB(240, 85, 85),
}

local notifyEvent = ReplicatedStorage:WaitForChild("Notify") :: RemoteEvent
local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")

-- One ScreenGui for every toast. ResetOnSpawn false keeps toasts on screen when the player respawns.
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "Notifications"
screenGui.ResetOnSpawn = false
screenGui.DisplayOrder = 10 -- above most other GUIs
screenGui.Parent = playerGui

local holder = Instance.new("Frame")
holder.Name = "Holder"
holder.AnchorPoint = Vector2.new(1, 0)
holder.Position = UDim2.new(1, -16, 0, 16)
holder.Size = UDim2.new(0, TOAST_WIDTH, 1, -32)
holder.BackgroundTransparency = 1
holder.Parent = screenGui

-- The list layout stacks the toasts under each other and closes gaps when one leaves
local layout = Instance.new("UIListLayout")
layout.SortOrder = Enum.SortOrder.LayoutOrder
layout.Padding = UDim.new(0, 8)
layout.Parent = holder

type Notice = { text: string, kind: string }

local queue: { Notice } = {}
local visible = 0
local counter = 0
local slideInfo = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)

local function show(notice: Notice, onClosed: () -> ())
	visible += 1
	counter += 1

	-- The slot holds the toast's place in the list; the card inside it slides
	local slot = Instance.new("Frame")
	slot.Name = "Toast"
	slot.LayoutOrder = counter
	slot.Size = UDim2.fromOffset(TOAST_WIDTH, TOAST_HEIGHT)
	slot.BackgroundTransparency = 1
	slot.Parent = holder

	local card = Instance.new("TextButton")
	card.AutoButtonColor = false
	card.Size = UDim2.fromScale(1, 1)
	card.Position = UDim2.fromScale(1.2, 0) -- start off screen to the right
	card.BackgroundColor3 = Color3.fromRGB(24, 22, 32)
	card.BackgroundTransparency = 0.1
	card.Text = notice.text
	card.TextColor3 = Color3.new(1, 1, 1)
	card.FontFace = Font.fromEnum(Enum.Font.BuilderSansMedium)
	card.TextSize = 18
	card.TextWrapped = true
	card.TextTruncate = Enum.TextTruncate.AtEnd
	card.TextXAlignment = Enum.TextXAlignment.Left
	card.Parent = slot

	local padding = Instance.new("UIPadding")
	padding.PaddingLeft = UDim.new(0, 16)
	padding.PaddingRight = UDim.new(0, 12)
	padding.Parent = card

	local corner = Instance.new("UICorner")
	corner.CornerRadius = UDim.new(0, 10)
	corner.Parent = card

	-- A coloured outline says what kind of notice it is. Border mode outlines the box, not the text.
	local stroke = Instance.new("UIStroke")
	stroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
	stroke.Thickness = 2
	stroke.Color = COLORS[notice.kind] or COLORS.info
	stroke.Parent = card

	TweenService:Create(card, slideInfo, { Position = UDim2.fromScale(0, 0) }):Play()

	local closed = false
	local function close()
		if closed then
			return -- clicked and timed out at once: close only once
		end
		closed = true
		local slideOut = TweenService:Create(card, slideInfo, { Position = UDim2.fromScale(1.2, 0) })
		slideOut:Play()
		slideOut.Completed:Wait()
		slot:Destroy()
		visible -= 1
		onClosed()
	end

	card.Activated:Connect(close) -- click or tap to close early
	task.delay(DURATION, close)
end

-- Show queued notices while there is room on screen
local function pump()
	while visible < MAX_VISIBLE and #queue > 0 do
		local notice = table.remove(queue, 1)
		if notice then
			show(notice, pump)
		end
	end
end

notifyEvent.OnClientEvent:Connect(function(text: unknown, kind: unknown)
	if typeof(text) ~= "string" or text == "" then
		return
	end
	local safeKind = if typeof(kind) == "string" and COLORS[kind] then kind else "info"
	table.insert(queue, { text = text, kind = safeKind })
	pump()
end)

RoCode builds it in the place you have open in Roblox Studio, on Windows or macOS with a desktop browser; on a phone the button sends the prompt and the link to your computer. Free to start, with free credits every day. More Roblox Studio scripts

Where to put it

Explorer: one RemoteEvent, the server module and this LocalScript
ReplicatedStorage
  Notify RemoteEvent new
ServerScriptService
  Notifications ModuleScript new
StarterPlayer
  StarterPlayerScripts
    NotificationClient LocalScript new

Settings you can change

DURATIONIn the script
Seconds each toast stays on screen before it slides away. Players can click a toast to close it sooner. Default: 4.
MAX_VISIBLEIn the script
Toasts on screen at once. More wait in a queue and appear as others leave. Default: 4.

This LocalScript only shows notices. Send them from the server with the Notifications module in Step 2.

Type-checked with luau-lsp strict against Roblox's API definitions on 14 November 2026. Not playtested in Studio yet: press Play and watch the Output window before you publish.

Prompt for RoCode

Add a notification system to my game: a RemoteEvent named Notify in ReplicatedStorage, a ModuleScript in ServerScriptService with send(player, text, kind) and sendAll(text, kind), and a LocalScript in StarterPlayerScripts that shows each notice as a toast in the top right with an info, success or error colour, at most 4 at once with a queue, slides in, closes on click and leaves after 4 seconds.

On this page
  1. Get the script
  2. How it works
  3. 1. RemoteEvent
  4. 2. Server module
  5. 3. Toasts
  6. 4. Send them
  7. Built-in pop-up
  8. 5. Test
  9. Common errors
  10. With RoCode
  11. Questions
  12. Sources

How the notification system works

Three pieces, each in its own place in the Explorer:

The three pieces
PieceWhereJob
Notify RemoteEventReplicatedStorageCarries each message from the server to a player's device. Both sides can see ReplicatedStorage.
Notifications ModuleScriptServerScriptServiceGives server scripts two easy functions: send and sendAll.
NotificationClient LocalScriptStarterPlayerScriptsDraws the toasts, runs the queue and the animations.

The server never touches the GUI. It sends a short string and a kind ("info", "success" or "error"), and each device decides how to draw it. That keeps the network traffic tiny and lets you restyle every notification in one place.

Step 1: Add the RemoteEvent

  1. In the Explorer, hover over ReplicatedStorage, click + and insert a RemoteEvent.
  2. Rename it Notify. The spelling and capital N matter: both scripts look it up by name.

Making it by hand, instead of from a script, means it already exists when the LocalScript starts, so the LocalScript never waits for it.

Step 2: The server module

  1. Hover over ServerScriptService, click + and insert a ModuleScript. Name it Notifications.
  2. Replace its contents with the code below.
ModuleScript in ServerScriptService named Notifications
-- ModuleScript in ServerScriptService named Notifications.
-- Server scripts call Notifications.send(player, text, kind) or Notifications.sendAll(text, kind).
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local notifyEvent = ReplicatedStorage:WaitForChild("Notify") :: RemoteEvent

local MAX_LENGTH = 120 -- longer messages are cut, so a mistake cannot fill the screen

export type Kind = "info" | "success" | "error"

local function clean(text: string): string
	if #text > MAX_LENGTH then
		return string.sub(text, 1, MAX_LENGTH - 3) .. "..."
	end
	return text
end

local Notifications = {}

-- One player
function Notifications.send(player: Player, text: string, kind: Kind?)
	notifyEvent:FireClient(player, clean(text), kind or "info")
end

-- Everyone in the server
function Notifications.sendAll(text: string, kind: Kind?)
	notifyEvent:FireAllClients(clean(text), kind or "info")
end

return Notifications

A ModuleScript runs only when another script calls require on it, and every script that requires it gets the same table back. That is why it is the right home for shared helpers like this one. The ModuleScripts guide explains require in more detail.

Step 3: The toast LocalScript

  1. In the Explorer, open StarterPlayer, hover over StarterPlayerScripts, click + and insert a LocalScript.
  2. Name it NotificationClient and paste the code below. It builds the GUI itself, so there is nothing to make in StarterGui.
LocalScript in StarterPlayerScripts named NotificationClient
-- LocalScript in StarterPlayerScripts named NotificationClient.
-- Shows each notice from the server as a toast in the top right, with a queue.
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")

local DURATION = 4 -- seconds each toast stays
local MAX_VISIBLE = 4 -- toasts on screen at once; the rest wait in a queue
local TOAST_WIDTH = 300
local TOAST_HEIGHT = 56

local COLORS: { [string]: Color3 } = {
	info = Color3.fromRGB(90, 150, 255),
	success = Color3.fromRGB(70, 205, 125),
	error = Color3.fromRGB(240, 85, 85),
}

local notifyEvent = ReplicatedStorage:WaitForChild("Notify") :: RemoteEvent
local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")

-- One ScreenGui for every toast. ResetOnSpawn false keeps toasts on screen when the player respawns.
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "Notifications"
screenGui.ResetOnSpawn = false
screenGui.DisplayOrder = 10 -- above most other GUIs
screenGui.Parent = playerGui

local holder = Instance.new("Frame")
holder.Name = "Holder"
holder.AnchorPoint = Vector2.new(1, 0)
holder.Position = UDim2.new(1, -16, 0, 16)
holder.Size = UDim2.new(0, TOAST_WIDTH, 1, -32)
holder.BackgroundTransparency = 1
holder.Parent = screenGui

-- The list layout stacks the toasts under each other and closes gaps when one leaves
local layout = Instance.new("UIListLayout")
layout.SortOrder = Enum.SortOrder.LayoutOrder
layout.Padding = UDim.new(0, 8)
layout.Parent = holder

type Notice = { text: string, kind: string }

local queue: { Notice } = {}
local visible = 0
local counter = 0
local slideInfo = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)

local function show(notice: Notice, onClosed: () -> ())
	visible += 1
	counter += 1

	-- The slot holds the toast's place in the list; the card inside it slides
	local slot = Instance.new("Frame")
	slot.Name = "Toast"
	slot.LayoutOrder = counter
	slot.Size = UDim2.fromOffset(TOAST_WIDTH, TOAST_HEIGHT)
	slot.BackgroundTransparency = 1
	slot.Parent = holder

	local card = Instance.new("TextButton")
	card.AutoButtonColor = false
	card.Size = UDim2.fromScale(1, 1)
	card.Position = UDim2.fromScale(1.2, 0) -- start off screen to the right
	card.BackgroundColor3 = Color3.fromRGB(24, 22, 32)
	card.BackgroundTransparency = 0.1
	card.Text = notice.text
	card.TextColor3 = Color3.new(1, 1, 1)
	card.FontFace = Font.fromEnum(Enum.Font.BuilderSansMedium)
	card.TextSize = 18
	card.TextWrapped = true
	card.TextTruncate = Enum.TextTruncate.AtEnd
	card.TextXAlignment = Enum.TextXAlignment.Left
	card.Parent = slot

	local padding = Instance.new("UIPadding")
	padding.PaddingLeft = UDim.new(0, 16)
	padding.PaddingRight = UDim.new(0, 12)
	padding.Parent = card

	local corner = Instance.new("UICorner")
	corner.CornerRadius = UDim.new(0, 10)
	corner.Parent = card

	-- A coloured outline says what kind of notice it is. Border mode outlines the box, not the text.
	local stroke = Instance.new("UIStroke")
	stroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
	stroke.Thickness = 2
	stroke.Color = COLORS[notice.kind] or COLORS.info
	stroke.Parent = card

	TweenService:Create(card, slideInfo, { Position = UDim2.fromScale(0, 0) }):Play()

	local closed = false
	local function close()
		if closed then
			return -- clicked and timed out at once: close only once
		end
		closed = true
		local slideOut = TweenService:Create(card, slideInfo, { Position = UDim2.fromScale(1.2, 0) })
		slideOut:Play()
		slideOut.Completed:Wait()
		slot:Destroy()
		visible -= 1
		onClosed()
	end

	card.Activated:Connect(close) -- click or tap to close early
	task.delay(DURATION, close)
end

-- Show queued notices while there is room on screen
local function pump()
	while visible < MAX_VISIBLE and #queue > 0 do
		local notice = table.remove(queue, 1)
		if notice then
			show(notice, pump)
		end
	end
end

notifyEvent.OnClientEvent:Connect(function(text: unknown, kind: unknown)
	if typeof(text) ~= "string" or text == "" then
		return
	end
	local safeKind = if typeof(kind) == "string" and COLORS[kind] then kind else "info"
	table.insert(queue, { text = text, kind = safeKind })
	pump()
end)

Each toast is two frames. The outer slot sits in the list, so the UIListLayout can stack it. The inner card is what moves: it starts at UDim2.fromScale(1.2, 0), which is past the right edge of its slot, and tweens to (0, 0). Tweening the slot itself would not work, because a list layout controls the position of its children and would undo the tween.

The queue keeps the screen readable. If a player collects 20 coins in two seconds, only 4 toasts show; the next appears as soon as one slides away, because close calls pump again when it finishes.

Step 4: Send notifications from your game

Any Script on the server can now require the module and send a notice. This example welcomes each player and tells everyone else they joined.

Script in ServerScriptService named WelcomeNotices
-- Script in ServerScriptService named WelcomeNotices.
local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")

type NotificationsModule = {
	send: (player: Player, text: string, kind: ("info" | "success" | "error")?) -> (),
	sendAll: (text: string, kind: ("info" | "success" | "error")?) -> (),
}
local Notifications = require(ServerScriptService:WaitForChild("Notifications")) :: NotificationsModule

Players.PlayerAdded:Connect(function(player: Player)
	Notifications.send(player, "Welcome! Collect coins to unlock new areas.", "info")
	for _, other in Players:GetPlayers() do
		if other ~= player then
			Notifications.send(other, player.DisplayName .. " joined the game", "success")
		end
	end
end)

The welcome is sent the moment the player joins, before their LocalScript has started. That still works: Roblox holds remote events for a device until a script connects to them. If nothing ever connects (for example the LocalScript has an error), the Output eventually shows Remote event invocation queue exhausted.

Some places to call it from other guides:

  • A failed purchase in a shop: Notifications.send(player, "Not enough coins", "error").
  • The start of a round in a round system: Notifications.sendAll("Round starting!", "info").
  • A redeemed code in a codes system: Notifications.send(player, "Code redeemed: +100 coins", "success").

The quick way: Roblox's built-in notification

Roblox has its own small pop-up in the bottom right of the screen. A LocalScript can show it with StarterGui:SetCore("SendNotification", ...). You cannot restyle it, but it takes a few lines.

LocalScript in StarterPlayerScripts named CoreNotice
-- LocalScript in StarterPlayerScripts named CoreNotice.
local StarterGui = game:GetService("StarterGui")

-- SetCore can fail for the first moments of a session, before Roblox's own scripts are ready,
-- so try a few times
local function sendCoreNotification(title: string, text: string)
	for _ = 1, 10 do
		local ok = pcall(function()
			StarterGui:SetCore("SendNotification", {
				Title = title,
				Text = text,
				Duration = 5,
			})
		end)
		if ok then
			return
		end
		task.wait(0.5)
	end
end

sendCoreNotification("Welcome", "Thanks for playing!")

Without the pcall and the retry, a call at the very start of the game can fail with SetCore: SendNotification has not been registered by the CoreScripts. Use the custom toasts from Step 3 when the notice needs your game's colours and font, or when the server sends it.

Step 5: Test it

  1. Press Play. The welcome toast slides in at the top right and leaves after 4 seconds.
  2. Click a toast: it slides away at once.
  3. To test the queue, stop the game and add this line under the welcome in WelcomeNotices: for i = 1, 8 do Notifications.send(player, "Test " .. i, "success") end. Play again: 4 show, the rest follow as they leave.
  4. Open the Test tab, choose 2 players under Clients and Servers and click Start to see the "joined the game" notice on the first player's screen.
  5. Reset your character (Esc, then Reset Character) while a toast is up: it stays, because ResetOnSpawn is false.

Common errors and fixes

If nothing shows, check the Output window for a red error or an orange warning first.

Infinite yield possible on Notify

The RemoteEvent is missing, misspelt or not in ReplicatedStorage. It must be named Notify exactly. See Infinite yield possible.

FireClient errors with "player argument must be a Player"

You passed something other than a Player, such as a character Model or a name. Use Players:GetPlayerFromCharacter(character) first. See FireClient: player argument must be a Player object.

Toasts appear but do not slide

Check you are tweening the card, not the slot. The UIListLayout controls the slot's position and overrides any tween on it.

The text has a coloured outline around each letter

The UIStroke is missing ApplyStrokeMode = Enum.ApplyStrokeMode.Border. On a text object it outlines the text unless you set Border.

Requiring the module errors

Server modules in ServerScriptService can only be required by server Scripts. A LocalScript cannot see ServerScriptService at all. If the module itself has an error, see Requested module experienced an error while loading.

Build it with RoCode

If you would rather not set this up by hand, RoCode can build it in the place you have open. RoCode is an independent AI agent for Roblox Studio, not made by Roblox: you describe the change in a web chat, and its Studio plugin creates the parts and scripts in your Explorer, so there is no code to paste.

You type

Add pop-up notifications to my game: a server module with send and sendAll, toasts in the top right in my game's purple, and use them for failed shop purchases and round starts.

RoCode does
  • Can read your place first to find the shop and round scripts, then adds the notification calls to them
  • Writes the scripts with Create Script and is told to compile-check each one with Check Script
  • Sets an undo point before and after each batch of changes, so Ctrl+Z steps back one batch at a time

How RoCode connects to Studio.

Questions

How do I make a notification in Roblox Studio?

For a custom one, send text from the server with a RemoteEvent and show it in a ScreenGui with a LocalScript (Steps 1 to 3). For Roblox's own pop-up, call StarterGui:SetCore("SendNotification", { Title = ..., Text = ... }) from a LocalScript.

How do I send a message to all players in Roblox?

Call FireAllClients on a RemoteEvent from a server Script. With the module in Step 2 that is Notifications.sendAll("text").

How do I show a message to one player only?

Use FireClient(player, ...) on the server, which reaches only that player's device. Notifications.send(player, "text") does this.

Why does my GUI disappear when I die?

ScreenGuis reset on respawn by default. Set ResetOnSpawn = false on the ScreenGui, as the toast script does.

Can a LocalScript send a notification to other players?

Not directly. It has to ask the server with a RemoteEvent, and the server decides whether to pass it on. Never pass on text a player typed without filtering it.

What is SetCore SendNotification?

A built-in Roblox function that shows a small pop-up with a title and text in the corner. It only works from a LocalScript and can fail in the first seconds of a session, so wrap it in pcall and retry.

Sources and further reading

How the code was checked: every script on this page passes Luau's strict type checker against Roblox's API definitions (luau-lsp, 14 November 2026). A type check catches misspelt APIs and wrong types, not game logic, so playtest in Studio before you publish.

Try RoCode on your own place.

Free every day, no card required. Install the plugin, describe the feature, and review what lands in Studio.