Seguinte, quero colocar esse tile de entrada do meu castle que o player só possa acessa-lo das 19hs as 22hs, se tentarem entrar antes disso receba a msg castle está fechado.
Segue o script
castletile.lua
function onStepIn(cid, item, position, fromPosition)
if getPlayerGuildId(cid) == getGlobalStorageValue(castle.storage) then
return true
end
if getPlayerGuildId(cid) == 0 then
doTeleportThing(cid, fromPosition)
return doPlayerSendTextMessage(cid, 25, "You don't have guild.")
end
if getPlayerAccess(cid) >= 3 then
return true
end
if getGlobalStorageValue(201307242201) - os.time() > 0 then
return true
end
setGlobalStorageValue(201307242201, os.time() + 1*60)
doBroadcastMessage("O player ".. getPlayerName(cid) .." invadiu o castelo, contenham-no!", 25)
end