Postado Maio 31, 2015 10 anos Autor Sem erros no distro, aumenta a velocidade porém não diminui depois do tempo ;x
Postado Maio 31, 2015 10 anos Em 31/05/2015 em 07:08, biel.stocco disse: Sem erros no distro, aumenta a velocidade porém não diminui depois do tempo ;x Tenta assim: local limite = 2500 -- limite não passar de 1000 --{nova velocidade, tempo que durará em segundos} local speedCfg = {2500, 3} local food = {[2456] = {150, "Glup Glup"}} function onUse(cid, item, fromPosition, itemEx, toPosition) if exhaustion.check(cid, 23007) == false then exhaustion.set(cid, 23007, 5) else return doPlayerSendCancel(cid, "Tempo de espera: " ..exhaustion.get(cid, 23007).."") end if food[item.itemid] ~= nil then if (getPlayerFood(cid) + food[item.itemid][1]) >= limite then doPlayerSendCancel(cid, "You are full.") else doPlayerFeed(cid, food) local speed = getCreatureSpeed(cid) setPlayerStorageValue(cid, Speed_Storage, speed - speedCfg[1]) doChangeSpeed(cid, -speed) doChangeSpeed(cid, speedCfg[1]) addEvent(function() if isCreature(cid) then doChangeSpeed(cid, getPlayerStorageValue(cid, Speed_Storage)) end end, speedCfg[2]*1000) doSendAnimatedText(getCreaturePosition(cid), food[item.itemid][2], TEXTCOLOR_WHITE) doSendMagicEffect(getCreaturePosition(cid), 25) doRemoveItem(item.uid, 1) doSendAnimatedText(getCreaturePosition(cid), "REDBUUUULL", TEXTCOLOR_BLUE) end return true end return true end ➥ Regras | Seções OTServ | Seções BOT
Postado Junho 1, 2015 10 anos Autor Em 31/05/2015 em 11:47, Wakon disse: Tenta assim: local limite = 2500 -- limite não passar de 1000 --{nova velocidade, tempo que durará em segundos} local speedCfg = {2500, 3} local food = {[2456] = {150, "Glup Glup"}} function onUse(cid, item, fromPosition, itemEx, toPosition) if exhaustion.check(cid, 23007) == false then exhaustion.set(cid, 23007, 5) else return doPlayerSendCancel(cid, "Tempo de espera: " ..exhaustion.get(cid, 23007).."") end if food[item.itemid] ~= nil then if (getPlayerFood(cid) + food[item.itemid][1]) >= limite then doPlayerSendCancel(cid, "You are full.") else doPlayerFeed(cid, food) local speed = getCreatureSpeed(cid) setPlayerStorageValue(cid, Speed_Storage, speed - speedCfg[1]) doChangeSpeed(cid, -speed) doChangeSpeed(cid, speedCfg[1]) addEvent(function() if isCreature(cid) then doChangeSpeed(cid, getPlayerStorageValue(cid, Speed_Storage)) end end, speedCfg[2]*1000) doSendAnimatedText(getCreaturePosition(cid), food[item.itemid][2], TEXTCOLOR_WHITE) doSendMagicEffect(getCreaturePosition(cid), 25) doRemoveItem(item.uid, 1) doSendAnimatedText(getCreaturePosition(cid), "REDBUUUULL", TEXTCOLOR_BLUE) end return true end return true end sem erros no distro, porém nem usar o item ta usando ;x
Postado Junho 1, 2015 10 anos Solução Opa foi mal eu troquei o item, tente agora: local limite = 2500 -- limite não passar de 1000 --{nova velocidade, tempo que durará em segundos} local speedCfg = {2500, 3} local food = {[2672] = {150, "Glup Glup"}} function onUse(cid, item, fromPosition, itemEx, toPosition) if exhaustion.check(cid, 23007) == false then exhaustion.set(cid, 23007, 5) else return doPlayerSendCancel(cid, "Tempo de espera: " ..exhaustion.get(cid, 23007).."") end if food[item.itemid] ~= nil then if (getPlayerFood(cid) + food[item.itemid][1]) >= limite then doPlayerSendCancel(cid, "You are full.") else doPlayerFeed(cid, food) local speed = getCreatureSpeed(cid) setPlayerStorageValue(cid, Speed_Storage, speed - speedCfg[1]) doChangeSpeed(cid, -speed) doChangeSpeed(cid, speedCfg[1]) addEvent(function() if isCreature(cid) then doChangeSpeed(cid, getPlayerStorageValue(cid, Speed_Storage)) end end, speedCfg[2]*1000) doSendAnimatedText(getCreaturePosition(cid), food[item.itemid][2], TEXTCOLOR_WHITE) doSendMagicEffect(getCreaturePosition(cid), 25) doRemoveItem(item.uid, 1) doSendAnimatedText(getCreaturePosition(cid), "REDBUUUULL", TEXTCOLOR_BLUE) end return true end return true end ➥ Regras | Seções OTServ | Seções BOT
Postado Junho 1, 2015 10 anos local limite = 2500 -- limite não passar de 1000 --{nova velocidade, tempo que durará em segundos} local speedCfg = {2500, 3} local food = {[2672] = {150, "Glup Glup"}} function onUse(cid, item, fromPosition, itemEx, toPosition) if exhaustion.check(cid, 23007) == false then exhaustion.set(cid, 23007, 5) else return doPlayerSendCancel(cid, "Tempo de espera: " ..exhaustion.get(cid, 23007).."") end if food[item.itemid] ~= nil then if (getPlayerFood(cid) + food[item.itemid][1]) >= limite then doPlayerSendCancel(cid, "You are full.") else doPlayerFeed(cid, food) local speed = getCreatureSpeed(cid) doChangeSpeed(cid, -speed) doChangeSpeed(cid, speedCfg[1]) addEvent(function(cid) if isCreature(cid) then doChangeSpeed(cid, -getCreatureSpeed(cid)) doChangeSpeed(cid, speed) end end, speedCfg[2]*1000) doSendAnimatedText(getCreaturePosition(cid), food[item.itemid][2], TEXTCOLOR_WHITE) doSendMagicEffect(getCreaturePosition(cid), 25) doRemoveItem(item.uid, 1) doSendAnimatedText(getCreaturePosition(cid), "REDBUUUULL", TEXTCOLOR_BLUE) end end return true end _ .-'` `} _./) / } .'o \ | } '.___.'`.\ {` /`\_/ , `. } ME DA UMA NOZ! \=' .-' _`\ { `'`;/ `, } _\ @ ; } /__`;-...'--' Cluck!
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.