someone help me with this talkaction, i want you to show the time of several storages instead of one.
or it could be by name example:
! time quest1
! time quest2
tfs 1.3
or it could be by name example:
! time quest1
! time quest2
tfs 1.3
Lua:
local STORAGE = 61398
function onSay(player, words, param)
local cur = math.max(player:getStorageValue(STORAGE) - os.time(), 0)
if cur == 0 then
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have time left.")
return false
end
local days = math.floor(cur / (60 * 60 * 24))
cur = cur - days * 60 * 60 * 24
local hours = math.floor(cur / (60 * 60))
cur = cur - hours * 60 * 60
local minutes = math.floor(cur / 60)
player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You have %d days, %d hours and %d minutes left.", days, hours, minutes))
return false
end