local talk = TalkAction("/boost", "!boost")
function talk.onSay(player, words, param)
local booststorage = player:getStorageValue(SKILL_BOOST_CONF.storage)
if booststorage and (booststorage > os.time()) then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Your boost is still active.')
return false
end
player:setStorageValue(SKILL_BOOST_CONF.storage, os.time() + SKILL_BOOST_CONF.time)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Boost has been activated. It will remain active for ' .. timeToReadable(SKILL_BOOST_CONF.time))
return false
end
function timeToReadable(t)
local str = os.date('!%T', t)
str = string.split(str, ':')
return tonumber(str[1]) .. 'h ' .. tonumber(str[2]) .. 'm ' .. tonumber(str[3]) ..'s.'
end
talk:separator(" ")
talk:register()