SendNotification (Method)

From Legacy Roblox Wiki
Revision as of 02:17, 22 June 2011 by >ArceusInator
Jump to navigationJump to search
Protected:This item is protected. Attempting to use it in a Script or LocalScript will cause an error.
SendNotification( String title, String message, Content picture, Number timeout, Function callback )
Returns nil
Description: Sends a notification through the GuiService which then creates a NotificationBox inside of game.CoreGui.RobloxGui.ControlFrame.NotificationBox to match your arguments.
Member of: GuiService









Example
If you're using the Command Bar or a CoreScript...
local guiService = game:GetService("GuiService")
local title = "Title"
local message = "Message"
local picture = "rbxasset://textures/Help_ovr.png"
local timeout = 10
local callback = function() print("Notification gone") end

guiService:SendNotification(title, message, picture, timeout, callback)

Would send something like this:

File:Notification.png

And then print "Notification gone" in 10 seconds or when it's clicked.


If you're using a Script or a LocalScript...

 local guiService = game:GetService("GuiService")
 local title = "Title"
 local message = "Message"
 local picture = "rbxasset://textures/Help_ovr.png"
 local timeout = 10
 local callback = function() print("Notification gone") end
 
 guiService:SendNotification(title, message, picture, timeout, callback) --> Unknown exception