Fala guys estava vagando pela net e achei esse script que faz com que mostre o tempo que dura o trap e achei muito útil para colocar no meu servidor porém sei muito pouco de script então tentei diversas vezes porém não consegui adaptar o código no meu script então vim até aqui para pedir uma ajuda a quem souber como adaptar esse código para o meu script
o código é esse
local combat = createCombatObject()setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)function onCastSpell(cid, var) doShowTimeByPos(cid, variantToPosition(var), 20, 20) -- essa linha aqui return doCombat(cid, combat, var)end
o script é esse
function isWalkable(pos, creature, pz, proj)if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 thenreturn falseendlocal creature = getTopCreature(pos)if creature.type > 0 thenreturn falseendif getTilePzInfo(pos) and not pz thenreturn falseendlocal n = not proj and 3 or 2for i = 0, 255 dopos.stackpos = ilocal tile = getTileThingByPos(pos)if tile.itemid ~= 0 and not isCreature(tile.uid) thenif hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) thenreturn falseendendendreturn trueendfunction onCastSpell(cid, var)if exhaustion.check(cid, 5750) == TRUE thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, 5750) .. " segundos para usar novamente.")return falseendexhaustion.set(cid, 5750, 8)local pos = getThingPosition(getCreatureTarget(cid))for x = -1,1 dofor y = -1,1 doposicao = {x = pos.x + x, y = pos.y + y, z = pos.z}if isWalkable(posicao) and posicao ~= {x = pos.x,y = pos.y,z = pos.z} thendoCreateItem(5750,1,posicao)endendendaddEvent(function()for x = -1,1 dofor y = -1,1 doposicao = {x = pos.x + x, y = pos.y + y, z = pos.z}if getTileItemById(posicao, 5750).uid > 0 thendoRemoveItem(getTileItemById(posicao, 5750).uid)endendendend,5*1000)return trueend
A função do código e fazer com que mostre o tempo de duração do trap porém não consegui de forma alguma adaptar o código para o script estou usando source 0.3.6