Hello, please help me add the remaining time to this script like in this photo
Lua:
local config = {
[59885] = {position = Position(32458, 32507, 6)}
}
local dukeCastle = MoveEvent()
function dukeCastle.onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return false
end
for index, value in pairs(config) do
if item.actionid == index then
if(item.actionid == 59885)then
if(player:getStorageValue(Storage.GraveDanger.CobraBastion.DrumeTimer) > os.time())then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have faced this boss in the last 20 hours.")
player:teleportTo(fromPosition, true)
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end
end
doSendMagicEffect(player:getPosition(), CONST_ME_POFF)
player:teleportTo(value.position)
end
end
end
dukeCastle:type("stepin")
for index, value in pairs(config) do
dukeCastle:aid(index)
end
dukeCastle:register()
Attachments
-
TIME.png456.7 KB · Views: 11 · VirusTotal