Postado Julho 14, 2018 7 anos 17 horas atrás, Emanueldk disse: tem como adaptar esse script somente para 1 double? estou tentando de varias formas aqui, mais sempre tem um erro pra mim deixar pra trás kkkk e o efeito do double nunca acaba, nunca mesmo, quando você usa um double e acaba o tempo, quando vai tentar usar outro fala que você já esta com um double ativo exp potion.xml <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Exp Potion" version="1.0" author="none" contact="none.com" enabled="yes"> <config name="exppotion"><![CDATA[ exp_info = {rate = 1, storage = {354870,354871,354872}, minutes = 2} -- rate 1 eh 50% function convertTime(a) if(type(tonumber(a)) == "number" and a > 0) then if (a <= 3599) then local minute = math.floor(a/60) local second = a - (60 * minute) if(second == 0) then return ((minute)..((minute > 1) and " minutos" or " minuto")) else return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo")) end else local hour = math.floor(a/3600) local minute = math.floor((a - (hour * 3600))/60) local second = (a - (3600 * hour) - (minute * 60)) if (minute == 0 and second > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo")) elseif (second == 0 and minute > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto")) elseif (second == 0 and minute == 0) then return (hour..((hour > 1) and " horas" or " hora")) end return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo")) end end end ]]></config> <event type="login" name="ExpPotionLogin" event="script"><![CDATA[ domodlib('exppotion') function onLogin(cid) if getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() > 0 then registerCreatureEvent(cid, "ExpPotionThink") local rates = getPlayerRates(cid) doCreatureSay(cid, "voce ainda tem "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time()).." de exp potion", TALKTYPE_ORANGE_1, true, cid) doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+exp_info.rate) setPlayerStorageValue(cid, exp_info.storage[3], 1) -- registro end return true end]]></event> <event type="think" name="ExpPotionThink" event="script"><![CDATA[ domodlib('exppotion') function onThink(cid, interval) if getPlayerStorageValue(cid, exp_info.storage[3]) > 0 and getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() <= 0 then doCreatureSay(cid, "Sua EXP Potion acabou!", TALKTYPE_ORANGE_1, true, cid) doPlayerSetExperienceRate(cid, getPlayerStorageValue(cid, exp_info.storage[2])) setPlayerStorageValue(cid, exp_info.storage[3], 0) -- registro end return true end]]></event> <talkaction words="!exppotion;/exppotion" event="buffer"><![CDATA[ domodlib('exppotion') return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() <= 0 and "Nenhuma Exp Potion ativa" or "voce tem "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time()).." de exp potion")]]></talkaction> <action itemid="7703" event="script"><![CDATA[ domodlib('exppotion') function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() > 0 then doCreatureSay(cid, "voce ainda tem "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time()).." de exp potion", TALKTYPE_ORANGE_1, true, cid) return true end local rates = getPlayerRates(cid) setPlayerStorageValue(cid, exp_info.storage[2], rates[SKILL__LEVEL]) doCreatureSay(cid, "Exp potion de ["..exp_info.minutes.." min] foi ativado!", TALKTYPE_ORANGE_1, true, cid) setPlayerStorageValue(cid, exp_info.storage[1], os.time()+exp_info.minutes*60) setPlayerStorageValue(cid, exp_info.storage[3], 1) -- registro doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+exp_info.rate) registerCreatureEvent(cid, "ExpPotionThink") doRemoveItem(item.uid,1) return true end]]></action> </mod> !exppotion ou /exppotion e pode mudar o itemid itemid="7703" vou colocar no pastebin pq o code do forum ta bugando os script: https://pastebin.com/raw/Xnhp2fCB 17 horas atrás, victor4312 disse: alguém vc quer que a exp acabe qndo morra ou desloge? [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Julho 14, 2018 7 anos https://pastebin.com/raw/9g3qg6h1 [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
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.