So, I kinda got bored and made this. What it does is: It lets you alert the users and prompt the users for a y/n answer. It uses the same UI that the Roblox Kick prompt does.
LINK:
Features:
Alert players with important messages using the Roblox UI prompt.
Prompt players for confirmation before performing critical actions.
Don’t be fooled by it being in ReplicatedStorage. If you call it through the Client then it will fail.
Here’s an example of how you can use New-Alerts:
-- Default left secondary right primary layout. Like kicks.
local na = require(game.ReplicatedStorage.ModuleScripts["New-Alert"]) -- gets New-Alert
na:NewAlert(game.Players.sharklier) {
Title="ThisIsACoolTitle",
Body="VeryCoolBody",
Buttons={
[1]={Text="Button1", Type="Secondary"},
[2]={Text="Button2",Type="Primary"}
},
Callback=function(buttonID)
print(buttonID)
end,}
-- Long button, like alerts.
local na = require(game.ReplicatedStorage.ModuleScripts["New-Alert"]) -- gets New-Alert
na:NewAlert(game.Players.sharklier) {
Title="ThisIsACoolTitle",
Body="VeryCoolBody",
Buttons={
[1]={Text="Button1", Type="LongPrimary"}, -- Or LongSecondary
},
Callback=function(buttonID)
print(buttonID)
end,}
-- Buttonless alerts
local na = require(game.ReplicatedStorage.ModuleScripts["New-Alert"]) -- gets New-Alert
na:NewAlert(game.Players.sharklier) {
Title="ThisIsACoolTitle",
Body="VeryCoolBody",
Buttons={
},
WaitTime = 5 -- 5 second wait before closing.
Callback=function(buttonID)
print(buttonID)
end,}
It’s a server script or local script. You can put it anywhere but, make sure if your using a local script put the module somewhere compatible with local scripts. EDIT:
Also, Confirms sadly don’t work if its not being required by a local script since the confirm runs on a remote event.
Great module, btw you should add a secondary button
Primary one is the one whose background is filled with white (the one you used), meanwhile the secondary button is the one with transparent background and with white outline.
Also can you make it so you can only put text and not button?
This is an absolutely incredible module. I have on question about this tho: How can I get the callbacks and do actions based around it? E.g if yes is pressed, it does something which i can customize
I redid the whole thing since looking back I don’t want to see anymore.
Creating a alert is different. its actually erm actually like way better and makes sense. it is way cooler now, just like update to it and I will grant you a wish to my genie ahaha. but seriously, dont use my old garbo version use this if you want.