Notify - simple notification system

Hello, I like your notification system !
But I have some problems to use the system.
correct me if i’m wrong, but for a LocalPlayer name, it’s : game.Players.LocalPlayer.Name ?

I tried this but its seems its doesn’t work.

Could you give me an example for a LocalPlayer?
Also, can you tell us where to put the ModuleScript please?

Thanks.

Edit:

I added .Name at the end of the player parameters by mistake, now the player parameter in the .notify is game.Players.LocalPlayer. In normal case, it should works. But I have a error.
image

I noticed also the ScreenGui simpleSuite isn’t in the PlayerGui but in the StarterGui. I think you made a mistake, you should edit the insertContainer function.

2 Likes

The 1st variable (player) should be a player object (eg: game.Players.Player1)

I recommend using game.Players:FindFirstChild("string") if you wanting to use a string instead of a player object.

simpleSuite is in StarterGui by default so it is inserted into new players PlayerGui.

And the module script should be put in StarterScriptService

1 Like

I want to send a notification to the LocalPlayer (me) and not the “Player1” for example.
When I try game.Players.LocalPlayer it returns me an error.
in the source code of your ModuleScript, at line 57, (if i’m not wrong) the script try to find “simpleSuite” in PlayerGui.
The simpleSuite is not in the PlayerGui. Can you check? I’m pretty sure you made a mistake.

2 Likes

This module looks like it’s designed to be ran from the server where the LocalPlayer isn’t present.

2 Likes

So we can’t make usefull notifications.

2 Likes

He didn’t make a mistake. Also, LocalPlayer only works in the client.

2 Likes

Yes we can, the whole point is being able to send notifications from the server. Maybe client functionality would be nice as well.

2 Likes

If you are wanting to send a notification to local player, you can do this using remote events.

In Local Script:

local event = game.ReplicatedStorage.SendNotificationToLocalPlayer
event:FireServer("Title","Text","Color",Duration)

In Server Script:

local event = game.ReplicatedStorage.SendNotificationToLocalPlayer
local notify = require(game.ServerScriptStorage:WaitForChild("notify"))
event.OnServerEvent:Connect(function(plr,title,text,color,duration)

notify.notify(plr,title,text,color,duration)

end)

This should work (haven’t tested it though)

2 Likes

ye I was making an update for my game, thanks btw :smiley:

2 Likes

you should be taking your own advice

2 Likes

I have some appropriate post here:

The module is great, love it! Maybe you can add something like a setting between your notification and Roblox’s?

2 Likes

To use Roblox’s notifications you can just do this:

local NotificationInfo = {Title="Title",Text="Text",Duration=5}

game.StarterGui:SetCore("SendNotification", NotificationInfo)

I recommend reading this so you can view the full capabilities of the SendNotification function

2 Likes

Found a bug:
It errors this:

ReplicatedStorage.notify:57: attempt to index nil with 'WaitForChild
1 Like

Recommended Update:

Change this:

selectedColor = colors.default

To this:

--New Color Defined For an Error of the Color3 Received
local colors = {
	NILColor = Color3.fromRGB(79, 79, 79), --New color
	alert = Color3.fromRGB(255, 105, 105),
	success = Color3.fromRGB(105, 255, 105),
	warning = Color3.fromRGB(255, 255, 105),
	info = Color3.fromRGB(105, 105, 255),
	default = Color3.fromRGB(255, 255, 255)	
} 

--Also replace the Old Selected ColorStuff, i had to make sure the Thing sent is actully a string or Table
			local selectedColor = colors.default
			if type(color)=="string" then
				
				if string.lower(color) == "alert" or string.lower(color) == "success" or string.lower(color) == "warning" or string.lower(color) == "info" or string.lower(color) == "default" then

					if string.lower(color) == "alert" then
						selectedColor = colors.alert
					end

					if string.lower(color) == "success" then
						selectedColor = colors.success
					end

					if string.lower(color) == "warning" then
						selectedColor = colors.warning
					end
					if string.lower(color) == "info" then
						selectedColor = colors.info
					end
					if string.lower(color) == "default" then
						selectedColor = colors.default
					end
				else
					selectedColor = colors.NILColor
				end	
				
			elseif type(color)=="table" then
				--The New DefaultColor System
				if color.R==nil or color.G==nil or color.B==nil then
					selectedColor = colors.NILColor
				else
					selectedColor = Color3.fromRGB(math.clamp(color.R*255,0,255), math.clamp(color.G*255,0,255), math.clamp(color.B*255,0,255))
				end
			else
				selectedColor = colors.NILColor
			end

i also Added Instructions for the new Color3 RGB system to the “Instructions” script:

[[
Current Colors:
	alert - Red
	success - Green
	warning - Yellow
	info - Blue
	default - White
	NILColor - Gray(this color means the custom color sent had an NIL value)
	
Custom Color System(Added In):
	1: To Display custom colors Just Send this through the regular Color varible, Start with this format:
		local Color = {
			["R"]=255, --Clamped To 0-255
			["G"]=0, --Clamped To 0-255
			["B"]=0, --Clamped To 0-255	
		}
	
	2: Then Send that into Notify just like before:
	   local notify = require(notify) -- Replace "notify" with the location of the module
	   local color = {["R"]=255, ["G"]=0, ["B"]=0,}
	   notify.notify(target,title,text,color,dur)

	3: You should Now have custom colors, 
		Side note!!: If it failed, the Notify Popups will use gray(Meaning You Did not send the Format Correctly)
]]	
1 Like

thats a lot of unnecessary if’s, you could just do

local selectedColor = colors[color:lower()] or colors.NILColor
2 Likes

Thanks i had thought of that before hand. However Starnamics is using an array of Color3’s. tso i reworked it to ignore those if’s, instead if the “Color” value is a table it will use the Array defined in the new instructions(ignoring that old part).

but i still have the old if’s there for backwards compatibility with older versions of NotifyV1
this way errors can be avoided.

if you(or others) want to push changes to the release branch on the github repo you can here:

2 Likes

Hey, sorry for the outdated module haha, made it when I was a much less experienced programmer so by far isn’t the best!

1 Like

Why should I use this over the built in SendNotification in StarterGUI?

1 Like

Honestly its a good foundation, May be outdated but i already have changes ready for a new look and a rework of how it functions, and i have the repo incase someone wants to make suggestions or smth.

its preference, i mean games with nice Flashy, round GUI’s tend to be more appealing. so Notify(i assume) was a replacement for the built in service, while adding a few features.

And i would recommend “SimplyNotifiedV2” or “SimplyNotifiedV3”.

if you want OLD and simple use the V1 on the repo i provided, however i recommend V2 or V3.