LUA ‐ How to use messageboxes and notifications - JordanSantiagoYT/FNF-JS-Engine GitHub Wiki
Messagebox & Notifications
Notifications
Introduction
There's honestly not a lot to talk about the Windows notification, except this only supports windows.
Tutorial
The ways to make a Windows notification happen is to use an event or a lua line.
Here are the ways on how to make one happen:
- Chart Editor Event (Windows Notification Event)
triggerEvent('Windows Notification', 'title', 'info/message')
runHaxeCode([sendWindowsNotification('title', 'info/message');](/JordanSantiagoYT/FNF-JS-Engine/wiki/sendWindowsNotification('title',-'info/message');))
Explainable things, title is the title, info/message is the text you want it to talk about.
Messageboxes
Introduction
This may seem like nonsense, but one of the most important uses for the messagebox is debugging code and "breaking the fourth wall" using simple tools.
Tutorial
Lua:
To make the game pause: triggerEvent('Popup', 'title', 'info/message')
To make the game not pause: triggerEvent('Popup (No Pause)', 'title', 'info/message')
Examples
Here's an example of the player's botplay being forced off.
THIS WAS MADE WITHOUT ANY TESTING, PLEASE MAKE A DISCUSSION PAGE IF THIS DOES NOT WORK
Notification
function onCreatePost()
notifTitle = 'Jordan Santiago'
notifMessage = 'Nope! Fuck you!'
-- change the notifTitle and notifMessage if you want to, it has to be in a string format, or it will not work.
if botplay then
triggerEvent('Windows Notification', notifTitle, notifMessage)
setPropertyFromClass('ClientPrefs', 'botplay', false)
end
end
function onResume()
runTimer('check thingy', 0.05)
end
function onTimerCompleted(tag)
if tag == 'check thingy' then
if botplay then
triggerEvent('Windows Notification', notifTitle, notifMessage)
setPropertyFromClass('ClientPrefs', 'botplay', false)
end
end
end