SendNotification (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Legend26
No edit summary
>JulienDethurens
Syntax highlighting.
Line 10: Line 10:


{{Example|If you're using the [[Command Bar]] or a [[CoreScript]]...
{{Example|If you're using the [[Command Bar]] or a [[CoreScript]]...
<pre>
<code lua>
local guiService = game:GetService("GuiService")
local guiService = game:GetService("GuiService")
local title = "Title"
local title = "Title"
Line 19: Line 19:


guiService:SendNotification(title, message, picture, timeout, callback)
guiService:SendNotification(title, message, picture, timeout, callback)
</pre>
</code>
Would send something like this:
Would send something like this:
[[Image:Notification.png|195px|center]]
[[Image:Notification.png|195px|center]]
Line 27: Line 27:
----
----
If you're using a [[Script]] or a [[LocalScript]]...
If you're using a [[Script]] or a [[LocalScript]]...
<pre>
<code lua>
  local guiService = game:GetService("GuiService")
  local guiService = game:GetService("GuiService")
  local title = "Title"
  local title = "Title"
Line 35: Line 35:
  local callback = function() print("Notification gone") end
  local callback = function() print("Notification gone") end
   
   
  guiService:SendNotification(title, message, picture, timeout, callback) --> Unknown exception</pre>
  guiService:SendNotification(title, message, picture, timeout, callback) --> Unknown exception</code>
}}
}}
*NOTE: Currently used by ROBLOX to send friend requests.
*NOTE: Currently used by ROBLOX to send friend requests.

Revision as of 03:04, 19 January 2012

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
{{{1}}}
  • NOTE: Currently used by ROBLOX to send friend requests.