LUA ‐ How 2 Messageboxes - JordanSantiagoYT/FNF-JS-Engine GitHub Wiki

LUA: How 2 Messageboxes

This may seem like nonsense, but one of its most important uses is debugging code and "breaking the fourth wall" using simple tools.

You can, for example, make a script using an event where when the player dies, a message mocking him appears.

There are several ways of making messageboxes, including:

  • Using """pure""" Lua ("Lua and Haxe" method),
  • Using external Batchfile/VBS scripts for messageboxes ("Lua and Batchfile" method)

Examples:

Lua and Haxe

-- from https://github.com/PatoFlamejanteTV/ImaturidadePlusPlus
function onCreatePost()
    addHaxeLibrary('Application', 'lime.app')
    runHaxeCode([Application.current.window.alert('Are you sure?', '...');](/JordanSantiagoYT/FNF-JS-Engine/wiki/Application.current.window.alert('Are-you-sure?',-'...');)) 
end

Lua and Batchfile

:: MessageBox System, by Pato
:: ----------------------------------------------------------------------------------
@echo off
IF EXIST temp.vbs (
    del temp.vbs
)
echo x=msgbox("%1" ,%3, "%2") >> temp.vbs
start temp.vbs
echo DEBUG: Message: %1, Title: %2.
:: del temp.vbs
:: message.bat Die ? 48
:: ^ .bat Name ^   ^  ^- Icon and Other Stuff (eg. "48 for Warning Message icon")
::             |   |- Title (eg. "...")
::             |- Content/Message/Text (eg. "I-N-F-E-C-T-E-D")
function onCreatePost()
	os.execute("cd .. & cd .. & cd TESTS & message.bat Muahahaah ? 48")
	end