Notification Module by ItzBloxyDev
This module allows you to easily send notification to in-game players.
Main features right now are to set the buttons, color and message/title.
Messages can be sent from SERVER and CLIENT
If there is a bug please let me know by messaging me here on the dev forum.
sorry for bad video quality (needed to be able to upload it)
links
After getting the module just place it somewhere in your game and you are ready to go!
Here is an example script you can use with an explanation on what to put where:
(Script in starter player scripts)
local module = require(replicatedStorage.NotificationModule)
local PromptSettings = module:New(
"Hi, "..game.Players.LocalPlayer.Name, -- Title
"Example notification", -- Message
{ -- Button table
[1] = {"Ok",Color3.fromRGB(255,0,255)}; -- [order] = {Text,color}
[2] = {"Yes",Color3.fromRGB(0, 251, 255)};
[3] = {"No",Color3.fromRGB(255, 0, 0)};
},
nil, --> Image id for top left
Color3.fromRGB(49,49,49), --> Color of the prompt
true, --> Whether the "X" will show
56524816 --> Sound when opening
)
prompt = PromptSettings:Prompt(game.Players.localPlayer)
repeat task.wait() until prompt.returned
print(prompt.returned) -- Name of button clicked
As you can see, you just need to create a new prompt setting and then you can prompt it to whoever you want and whenever you want.
On top of that, there are many different functions you can play around with.
Functions:
Module
settings = module:New(
"Hi, "..game.Players.LocalPlayer.Name, -- Title
"Example notification", -- Message
{ -- Button table
[1] = {"Ok",Color3.fromRGB(255,0,255)}; -- [1] is order, the table is the [1] message and [2] color
[2] = {"Yes",Color3.fromRGB(0, 251, 255)};
[3] = {"No",Color3.fromRGB(255, 0, 0)};
},
nil, --> Image id for top left
Color3.fromRGB(49,49,49), --> Color of the prompt
true, --> Whether the "X" will show
56524816 --> Sound when opening
)
Creates a new prompt setting that can be used to send notifications
created settings
prompt = settings:Prompt(player)
Sends the notification to the given player (player). Player not required on client.
created prompt
prompt:Close()
Simply closes the prompt.
prompt:PromptExists()
Checks if the prompt can be seen on the player’s screen.
prompt:ChangeButtonText(buttonText,NewText)
Changes all buttons with the given text (buttonText) to a new text (NewText)
prompt:HideExit()
Hides the prompt’s exit button (Top right “X”)
prompt:ShowExit()
Shows the prompts exit button (Top right “X”)
prompt:ChangeButtonColor(buttonText,color)
Changes the color of all buttons with the text (buttonText) to the color (color)
prompt:HideButton(buttonText)
Hides buttons with the given text (buttonText)
prompt:ShowButton(buttonText)
Shows buttons with the given text (buttonText)
prompt:ChangeMessage(message)
Changes the prompts message to (message)
prompt:ChangeTitle(title)
Changes the prompts title (title)
prompt:ChangeColor(color)
Changes the prompts color to (color)
Thank you! (any bugs dm me)