function onUse(cid, item, fromPosition, itemEx, toPosition) local config = { soul = 0, -- amount of souls to start timer = 1, -- time in minutes rateStamina = 10, -- percent } if getPlayerSoul(cid) >= config.soul then local myOutfit, cstamina, secondPos, changeType, changeStraw, straw = getCreatureOutfit(cid), getPlayerStamina(cid), toPosition, 0, 0, 0 local clookType = myOutfit.lookType if itemEx.itemid == 5501 then toPosition = toPosition.x - 1 straw = 5500 elseif itemEx.itemid == 5503 then toPosition = toPosition.y - 1 straw = 5502 elseif itemEx.itemid == 5500 then secondPos = secondPos.x + 1 straw = itemEx.itemid elseif itemEx.itemid == 5502 then secondPos = secondPos.y + 1 straw = itemEx.itemid end if itemEx.itemid == 5500 or 5501 then if getPlayerSex(cid) == PLAYERSEX_FEMALE then changeType = 7841 changeStraw = 7842 else changeType = 5496 changeStraw = 5497 end elseif itemEx.itemid == 5502 or 5503 then if getPlayerSex(cid) == PLAYERSEX_FEMALE then changeType = 7843 changeStraw = 7844 else changeType = 5498 changeStraw = 5499 end end doTeleportThing(cid, toPosition, false) doCreatureChangeOutfit(cid, {lookTypeEx = changeType}) doCreatureSetNoMove(cid, true) local toItem = getTileItemById(secondPos, straw) if toItem and changeStraw then doTransformItem(toItem.uid, changeStraw) end -- check se o item existe doSendAnimatedText(toPosition, "RESTING", TEXTCOLOR_ORANGE) addEvent(function() if isCreature(cid) then doPlayerSetStamina(cid, cstamina + cstamina * config.rateStamina) doCreatureChangeOutfit(cid, {lookType = clookType}) local toItem = getTileItemById(secondPos, changeStraw) if toItem then doRemoveItem(toItem.uid, 1) end -- check se o item existe doCreateItem(straw, 1, secondPos) doCreatureSetNoMove(cid, false) doSendAnimatedText(toPosition, "RESTED", TEXTCOLOR_GREEN) end end, config.timer * 60 * 1000) end return true end



info
Grupo: Campones
Registrado: 28/07/18
Posts: 1
Reputação: 0
Version: TFS 0.4
Base:
Olá. Eu tenho esse script, mas ele não está funcionando corretamente, ele deveria regenerar a resistência, mas quando eu usá-lo eu tenho 3 erros no console e não funciona.
aqui está o roteiro. também a roupa não está na posição correta (veja imagem)
Qual erro está surgindo?
Script: