Skip to content

BuiltAPI

BuiltAPI.NewNotification

WARNING

Some methods are reserved for future use (such as NotificationVisibility).

lua
NewNotification(
    Notifications: Table {
        Player: Player,
        Body: string,
        HeaderText: string,
        Icon: string?,
        OpenDuration: number?,
        Buttons: Table?,
        NotificationVisibility: "PLAYER" | "ALL_ADMINS",
        ShelfVisibility: "FOR_TARGET" | "ALL_ADMINS" | "DO_NOT_DISPLAY",
        NotificationPriority: "CRITICAL" | "NORMAL" | "LOW"
    }
): nil
lua
NewNotification({
    ["Player"] = game.Players[1],
    ["Body"] = "Hello, world!",
    ["HeaderText"] = "Alert",
    ["Icon"] = "rbxassetid://0000",
    ["OpenDuration"] = 5,
    ["Buttons"] = {
        {
            Text = "Click me",
            Icon = "rbxassetid://0000",
            OnClick = function ()
                print("I got clicked!")
            end
        }
    },
    ["NotificationVisibility"] = "PLAYER",
    ["ShelfVisibility"] = "DO_NOT_DISPLAY",
    ["NotificationPriority"] = "LOW"
})

Immediately displays a new notification (or multiple) with the given details.
If OpenDuration is not specified, the close button will be available immediately.

BuiltAPI.AppNotificationBlip

WARNING

This method is still under development and it is reserved for future use.

Creates a new notification icon on your app's tile. Does not persist over saves.

lua
AppNotificationBlip(
    {
        Player: player,
        Count: number
    }
): table: {Success: bool, ErrorMessage: nil | string}
lua
AppNotificationBlip({game.Players.pyxfluff, 5})

BuiltAPI.IsAdmin

lua
IsAdmin(Player: Player, GroupsList: Table{Number}?): Table
lua
{
    false,                          -- Is Admin?
    "Found in AdminIDS override",   -- Reasoning
    1,                              -- Rank ID (0 if not applicable)
    "NonAdmin"                      -- Rank Name (generic "NonAdmin" or "Admin" if not applicable)
}

WARNING

GroupsList exists only as a workaround for a missing Roblox API.
If you provide a non-admin only group, anyone in it will have full admin access!

WARNING

The following methods are pending removal in a future version and will be condensed into a simple (API).NewRemote function. Please wrap code in a pcall until the 2.0 API is out.

BuiltAPI.NewRemoteEvent

lua
NewRemoteEvent(Name: string, OnServerEvent: Function, ...): RemoteEvent
lua
NewRemoteEvent(
    "SendMessage",
    function (player, message)
        print(`Message from {player.Name}: {message}`)
    end
)

Creates a new RemoteEvent with the given name, callback, and additional arguments. If an event with the given name already exists, the existing event will be returned without OnServerEvent being attached.

If the provided OnServerEvent is not a function, it will be ignored.
Any additional arguments will be passed along to the internal :Connect call.

BuiltAPI.NewRemoteFunction

lua
NewRemoteFunction(Name: string, OnServerInvoke: Function): RemoteFunction
lua
NewRemoteFunction(
    "GetUselessNumber",
    function (player) return 6 end
)

Creates a new RemoteFunction with the given name and callback. If an event with the given name already exists, the existing event will be returned without OnServerInvoke being attached.

If the provided OnServerInvoke is not a function, it will be ignored.