NativeMsgBox- Studio-matching message boxes for plugins

Since Roblox apparently doesn’t want to give basic plugin API that is already in all of the other game engines to us, I made one myself. It’s not 1:1 to Studio’s messageboxes, but it works for now, I guess.


How it looks:

image

(also supports light mode but i’m not destroying my eyes again to show you it)

How it works

You can make a new message box by doing so:

local NativeMsgBox = require(script:WaitForChild('NativeMsgBox'))
NativeMsgBox.new('Title', 'Message', {'Yes_BLUE', 'No'}, 'Close')

Third parameter is which buttons you want. Choose how many you want, and type _BLUE at the end to make it blue. Note that you aren’t restricted to just Yes, No, OK and Cancel, you can literally type whatever you want.

Fourth is the behaviour of clicking the buttons. There’s only ‘Close’ for now. .new returns the self table, so you can do something like this for custom behaviour:

local NativeMsgBox = require(script:WaitForChild('NativeMsgBox'))
local Box = NativeMsgBox.new('Title', 'Message', {'Yes_BLUE', 'No'}, 'Close')

Box.gui.ButtonHolder['Yes_BLUE'].MouseButton1Up:Connect(function()
    print("Test")
end)

[‘Yes_BLUE’] is the name of the button string you inputted in the third parameter of .new.

Get the example plugin

Contains the same code as above, and the module itself.


Enjoy. Remember to leave your most pessimistic comments about this!

6 Likes

Got none. Great resource, will be sure to use this in plugins!

1 Like

Sorry for the bump. I am looking forward to using this messagebox module in my plugin. Does this module support input too (as in TextBox input), or do we have to add it ourselves? Thank you!