• 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 if with os date

tim26

Member
Joined
Aug 12, 2008
Messages
618
Reaction score
11
Location
Poland
i want if to os date something like that

if os.date("%X") == "Tuesday" then but it don't work
 
Code:
local config = {
	["Monday"]= {x=32293, y= 31207, z= 7}, 
	["Tuesday"] = {x=32301, y= 32837, z= 7}, 
	["Wednesday"] = {x=32576, y= 32754, z= 7},
	["Thursday"] = {x=33066, y= 32885, z= 6},
	["Friday"] = {x=33234, y= 32483, z= 7},
	["Saturday"] = {x=33170, y= 31809, z= 6},
	["Sunday"]= {x=32328, y= 31782, z= 6}

			}


	if os.date("%X") == "00:00:00" then
		teleported = 0
	end
	local day = config[os.date("%A")]
	if day then
		pos = day
		if teleported ~= 1 then
			doTeleportThing(nid, pos)
			selfMoveTo(pos.x-1, pos.y, pos.z)
			selfSay(day.x)
			teleported = 1
		end
	end
end


that is my full script to message

Code:
if os.date("%X") == "Tuesday" then
if msgcontains(msg, 'violence') then
			if getPlayerStorageValue(cid,9009) < 1 then
				npcHandler:say('Convincing Ajax that it is not always necessary to use brute force... this would be such an achievement. Definitely a hard task though. ...', cid)
				delayedSay17('Listen, I simply have to ask, maybe a stranger can influence him better than I can. Would you help me with my brother?', 1000, cid)
								talkset(cid,id,1)
			end
end
 
this script work to teleportanion..... but i want other function if to message lke that if os.date("%X") == "Tuesday" day not hour
 
...........
Read please? I meant like you do instead of Tuesday, tue, instead of monday, mon, instead of friday, fri get it?
 
Back
Top