Postado Dezembro 8, 2016 8 anos Bom dia pessoal do TK.. estou com um problema em um scripts de exp potion! ao eu usar o iten ele fala que termina dele acabara em 4he 52 minutos.. 11:06 You still have 4 hours 44 minutes 13 seconds left of extra experience. Mesmo eu estando deslogado, a horas estão passando, porque estando offline a hora continua contando??? queria saber onde eu modifico pra ele usar em 2h em 2h! ou onde eu tenho que modificar.. Se possivel colocar ele pra portugues?? Exp Potion.xml local config = { rate = 2.0, -- Rate que vai ficar o Scroll. time = 2, -- Tempo dado pelo Scroll. storage = 20011 } local function endExpRate(cid) if not isPlayer(cid) then return end doPlayerSetRate(cid, SKILL__LEVEL, 6.0) setPlayerStorageValue(cid, config.storage, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.") end function onUse(cid, item, fromPosition, itemEx, toPosition) local timeLeft = getPlayerStorageValue(cid, 20011) if timeLeft > os.time() then local timeTable = os.date('*t', timeLeft - (os.time() + 10)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("You still have %d %s %d %s %d %s left of extra experience.", timeTable.hour, timeTable.hour > 1 and "hours" or "hour", timeTable.min, timeTable.min > 1 and "minutes" or "minute", timeTable.sec, timeTable.sec > 1 and "seconds" or "second")) return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, string.format("Your extra experience rate is now: %d. It will last for %d hours.", config.rate, config.time)) doPlayerSetRate(cid, SKILL__LEVEL, config.rate) setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600 * 100) addEvent(endExpRate, config.time * 3600 * 100, cid) doRemoveItem(item.uid, 1) return true end up Editado Dezembro 8, 2016 8 anos por mateusmoretti (veja o histórico de edições)
Postado Dezembro 9, 2016 8 anos local config = { rate = 2.0, -- Rate que vai ficar o Scroll. time = 1, -- Tempo dado pelo Scroll. storage = 20011 } local function endExpRate(cid) if not isPlayer(cid) then return end if(getPlayerStorageValue(cid,20011) == 20011)then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode usar outra scroll ate que a primeira acabe!") return false else doPlayerSetRate(cid, SKILL__LEVEL, 6.0) setPlayerStorageValue(cid, config.storage, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.") end function onUse(cid, item, fromPosition, itemEx, toPosition) local timeLeft = getPlayerStorageValue(cid, 20011) if timeLeft > os.time() then local timeTable = os.date('*t', timeLeft - (os.time() + 10)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("You still have %d %s %d %s %d %s left of extra experience.", timeTable.hour, timeTable.hour > 1 and "hours" or "hour", timeTable.min, timeTable.min > 1 and "minutes" or "minute", timeTable.sec, timeTable.sec > 1 and "seconds" or "second")) return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, string.format("Your extra experience rate is now: %d. It will last for %d hours.", config.rate, config.time)) doPlayerSetRate(cid, SKILL__LEVEL, config.rate) setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600 * 100) addEvent(endExpRate, config.time * 3600 * 100, cid) doRemoveItem(item.uid, 1) return true end end Testa ae, se der erro me avisa! Editado Dezembro 9, 2016 8 anos por Kamiz Complemento (veja o histórico de edições)
Postado Dezembro 9, 2016 8 anos Autor 2 minutos atrás, Kamiz disse: local config = { rate = 2.0, -- Rate que vai ficar o Scroll. time = 1, -- Tempo dado pelo Scroll. storage = 20011 } local function endExpRate(cid) if not isPlayer(cid) then return end if(getPlayerStorageValue(cid,20011) == 20011)then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode usar outra scroll ate que a primeira acabe!") return false else doPlayerSetRate(cid, SKILL__LEVEL, 6.0) setPlayerStorageValue(cid, config.storage, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.") end function onUse(cid, item, fromPosition, itemEx, toPosition) local timeLeft = getPlayerStorageValue(cid, 20011) if timeLeft > os.time() then local timeTable = os.date('*t', timeLeft - (os.time() + 10)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("You still have %d %s %d %s %d %s left of extra experience.", timeTable.hour, timeTable.hour > 1 and "hours" or "hour", timeTable.min, timeTable.min > 1 and "minutes" or "minute", timeTable.sec, timeTable.sec > 1 and "seconds" or "second")) return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, string.format("Your extra experience rate is now: %d. It will last for %d hours.", config.rate, config.time)) doPlayerSetRate(cid, SKILL__LEVEL, config.rate) setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600 * 100) addEvent(endExpRate, config.time * 3600 * 100, cid) doRemoveItem(item.uid, 1) return true end Testa ae, se der erro me avisa! deu erro [9/12/2016 11:34:18] [Error - LuaInterface::loadFile] data/actions/scripts/exppotion2.lua:31: 'end' expected (to close 'function' at line 6) near '<eof>' [9/12/2016 11:34:18] [Error - Event::checkScript] Cannot load script (data/actions/scripts/exppotion2.lua) [9/12/2016 11:34:18] data/actions/scripts/exppotion2.lua:31: 'end' expected (to close 'function' at line 6) near '<eof>'
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.