How to make a Notification System

Welcome! I’m going to show you how to make a Notification system.
First you want to go into your Roblox game and make a Screen Gui in “StarterGui” and call it “Notification”.
Screenshot 2022-03-09 173124
Next your going to want to add a Frame into the screen gui, name it Notifications.
Screenshot 2022-03-09 173247
Then add in a TextLabel, and a local script.
You can ignore the other items in my Gui.
Screenshot 2022-03-09 173354
Next were going to want to go into our local script and code the Notification system.

local Event = game.ReplicatedStorage.Events.Notification
local ErrorSound = game.SoundService.Fail

Event.OnClientEvent:Connect(function(val)
	if val == true  then
		ErrorSound:Play()
		script.Parent.Visible = true
		script.Parent.Text = "Your text here"
		wait(3)
		script.Parent.Visible = false
		script.Parent.Text = ""
	end
	
	
end)

You can make the text say whatever you want!
Next we need to make a RemoteEvent in ReplicatedStorage, Make a folder called “Events” Put the RemoteEvent in the folder.
Name the RemoteEvent “Notification”
Next we need to make the script that will send the message,
go into the script that you want to send a Notification.
Here is the script:

	local ReplicatedStorage = game:GetService("ReplicatedStorage")
		local EventsFolder = ReplicatedStorage:FindFirstChild("Events")
		local Notification = EventsFolder:FindFirstChild("Notification")

Notification:FireClient(player, true)

Thats all!
If you need help, reply to this post.
Here is a link to the place with all the scripts: The Game

9 Likes

I forgot to say this, but if you want to add more notifications, all you need to do is copy

	if val == true  then
		ErrorSound:Play()
		script.Parent.Visible = true
		script.Parent.Text = "Your text here"
		wait(3)
		script.Parent.Visible = false
		script.Parent.Text = ""
	end

and change the if val == “Your new” then
change the Your new to what ever you want to call your notification.
Next copy this code:

	local ReplicatedStorage = game:GetService("ReplicatedStorage")
		local EventsFolder = ReplicatedStorage:FindFirstChild("Events")
		local Notification = EventsFolder:FindFirstChild("Notification")

Notification:FireClient(player, true)

Change the true to whatever you put as Your Text.

3 Likes

Pretty intresting and helpful, not gonna lie…

After 2 years, you probably already know this, but for others:

Instead of using the same notification label for every message, you should clone the label, and delete it later. You can do whatever animation to show and hide it. They can be stacked ontop of each other easily if you put a UIListLayout in with all the slots. It would go in the container in the ScreenGui, and not in each template.

This is the ideal way! You should eventually take it a step further with object oriented programming so you can change the color, duration, icon, etc.

2 Likes