local config = { -- hour 0-23 localtime
time_start = 16,
time_end = 17
}
function onStepIn(player, item, position, fromPos)
if isPlayer(player) then
local current_hour = os.date('*t', os.time()).hour
if current_hour >= config.time_start and current_hour <= config.time_end then
doPlayerSendTextMessage(player, MESSAGE_EVENT_DEFAULT, 'Welcomen.')
return true
end
doPlayerSendTextMessage(player, MESSAGE_EVENT_DEFAULT, 'Sorry, not posible.')
doTeleportThing(player, fromPos)
doSendMagicEffect(fromPos, CONST_ME_TELEPORT)
end
return true
end