سويت لك فنكشن بسيط ..
فقط تحط الساعه و الدقيقة والثانية
function isTime ( hour , minute , second )
for i,args in ipairs ( { hour,minute,second } ) do
if ( type ( args ) ~= "number" ) then
return false
end
end
if ( second == nil or second < 0 ) then second = 0 end
local Real = getRealTime()
local Hours,Minutes,Seconds = Real["hour"],Real["minute"],Real["second"]
if ( Hours == hour and Minutes == minute and Seconds == second ) then
return true
else
return false
end
end
addCommandHandler("checkTime",
function ( )
local Real = getRealTime()
local Hours,Minutes,Seconds = Real["hour"],Real["minute"],Real["second"]
if ( isTime ( 12 , 15 , 15 ) ) then
outputChatBox("Yeah Time is : 12:15:15",255,255,255,true)
else
outputChatBox("Time is "..Hours..":"..Minutes..":"..Seconds.."",255,255,255,true)
end
end
)