Shortcuts | Version 1.2
What’s new?
Improved Source Filter
Requesting input using the built-in Shortcut method.
Note: In this case, source is shown as unsafe due to the use of require, don’t worry.
Let’s explore this script!
local Shortcut = require(game:GetService("CoreGui")._Shortcut_Actions)
local User = Shortcut.AskData {
Placeholder = "What's ur username?"
}
if User then
Shortcut.SendNotification(`Hello, {User}!`, 2.5)
end
The built-in Shortcut module allows us to create custom input from Shortcuts and the user.
Ask Data
Shortcut.AskData(Data: {Filter: string?, Placeholder: string?})
This function allows you to prompt for input and waits for the user to respond.
Arguments:
Data → table {}
Filter → string or nil
Placeholder → string or nil
In the first argument to Filter you enter what type of data the user can enter.
-- Default
Filter = Shortcut.Filter.Both
-- Number or string
Filter = Shortcut.Filter.Numbers
Filter = Shortcut.Filter.String
That is, if you select a number filter, the user will be able to enter only a number or “” (nothing).
In the second argument to Placeholder, you choose which tooltip will be displayed to the user.
Note: The function returns false if the user clicked the cancel button.
Send Notification
Shortcut.SendNotification(Context: string, Time: number?)
This feature allows you to display a notification on the user’s screen.
Arguments:
Context → string
Time → number or nil
The first argument, Сontext, is what the user will see on the screen. That is your message.
-- Default
"Notification"
-- Custom
string
In the second argument Time you can specify the time at which the notification will appear in seconds.
-- Default
5
-- Custom
number
Note: This function returns a :Wait()
function with which you can yield until the notification disappears.
And…
Errors in your Shortcuts are now displayed in the console, allowing you to quickly find them.
If the command is executed, a pause icon appears; if the command failed due to an error, a cross icon appears.
Improved design and interaction.
You can now change the icon of your Shortcut in edit mode.
Download in Roblox Marketplace