I’ve been trying to add some date-based randomisation to the UI and am getting crashes. I am not sure if the
date() function is just not accessible outside of the gamerule script or what…
To start with I was just trying to get two numbers, the day of the month and the number of the month into the log. I added the following to *\ui\newui\loadingscreen.lua
local dateMonth = date("%m") local dateDay = date("%d") print("Month: "..dateMonth..", Day: "..dateDay)
Log just spits this out
LUA 'DATA:UI/NewUI/LoadingScreen.lua' -- parameter: <name> or `[' expected; last token read: `local' at line 16 in string ""
I can see
date() used successfully elsewhere… just want to know if I can get these values for the UI to use