• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Global Event tags.

conde2

Active Member
Joined
Jun 22, 2008
Messages
348
Reaction score
44
Hello, I created a global event using the onTime function, so its possible to add in the tag the day that the script will run??
I'm using this tag in a mod file:

<globalevent name="start_event" time="21:15" event="script">

I want to add a specific day to run the event, how can i do this??
 
add in the script:

Lua:
if(string.lower(os.date("%A")) == "tuesday") then -- example for tuesday

Yes i know how to do it by scripting, but the language of my OS is PT-BR so i dont know if this will make difference when using this and configuring this in home host and dedicated host =s
That's why i'm not using this, i will print the function is easier to know =) thx
 
I know this is ancient history by now, but in case someone else ever ran into such an issue...

you could have simply tried this in the Lua intrepreter:
print(string.lower(os.date("%A")))
to see what the output would be. You could have just tested for both possible strings. However, the 'best practices' way would be to just use %w which returns 0-6 for Sunday-Saturday in any Locale
 
Back
Top