Postado Março 30, 2021 4 anos .Qual servidor ou website você utiliza como base? 8.60 Qual o motivo deste tópico? Bom dia familia, tranquilo? Então rapaziada, to com um script de TRAP que está bugando na hora que cerca o alvo. Se eu estiver no SQM do lado do alvo, a pedra aparece em cima de mim. Queria que quando ao usar a trap, as pedras aparecessem somente onde tem "espaço" para elas aparecerem. Exemplo: se tiver algumas pessoas cercando o alvo, as pedras não apareceriam nos SQMs que essas pessoas estão. Vou deixar o SCRIPT que estou usando abaixo. Alguém pode me ajudar pfv? Você tem o código disponível? Se tiver publique-o aqui: local c = { trapId = 2718, -- id do trap trapTime = 4, -- tempo do trap em segundos exhaustStorage = 1060602, -- storage do exhausted exhaustTime = 20 -- tempo do exhausted em segundos } local trap = createCombatObject() setCombatArea(trap, createCombatArea({ {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,1,1,1,0,0}, {0,0,1,2,1,0,0}, {0,0,1,1,1,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0} })) function onTargetTile(cid, pos) doCreateItem(c.trapId, 1, pos) addEvent(function() local thing = getTileItemById(pos, c.trapId).uid if(thing ~= 0) then doRemoveItem(thing) end end, c.trapTime * 1000) end setCombatCallback(trap, CALLBACK_PARAM_TARGETTILE, "onTargetTile") function onCastSpell(cid, var) local target = variantToNumber(var) if(isPlayer(cid)) then if(math.max(0, (exhaustion.get(cid, c.exhaustStorage) or 0)) > 0) then doPlayerSendCancel(cid, "You are exhausted. Wait " .. exhaustion.get(cid, c.exhaustStorage) .. " second" .. (exhaustion.get(cid, c.exhaustStorage) > 1 and "s" or "") .. ".") return false else exhaustion.set(cid, c.exhaustStorage, c.exhaustTime) end end local effeito1 = {x=getThingPosition(getCreatureTarget(cid)).x-1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z} local effeito2 = {x=getThingPosition(getCreatureTarget(cid)).x-1, y=getThingPosition(getCreatureTarget(cid)).y-1, z=getThingPosition(getCreatureTarget(cid)).z} local effeito3 = {x=getThingPosition(getCreatureTarget(cid)).x-1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z} local effeito4 = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z} local effeito5 = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y-1, z=getThingPosition(getCreatureTarget(cid)).z} local effeito6 = {x=getThingPosition(getCreatureTarget(cid)).x, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z} local effeito7 = {x=getThingPosition(getCreatureTarget(cid)).x, y=getThingPosition(getCreatureTarget(cid)).y-1, z=getThingPosition(getCreatureTarget(cid)).z} local effeito8 = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z} doSendMagicEffect(effeito1, 111) doSendMagicEffect(effeito2, 111) doSendMagicEffect(effeito3, 111) doSendMagicEffect(effeito4, 111) doSendMagicEffect(effeito5, 111) doSendMagicEffect(effeito6, 111) doSendMagicEffect(effeito7, 111) doSendMagicEffect(effeito8, 111) doCombat(cid, trap, var) return true end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. WhatsApp_Video_2021-03-30_at_08_38_51.mp4 Em 30/03/2021 em 11:41, raphadoidera disse: .Qual servidor ou website você utiliza como base? 8.60 Qual o motivo deste tópico? Bom dia familia, tranquilo? Então rapaziada, to com um script de TRAP que está bugando na hora que cerca o alvo. Se eu estiver no SQM do lado do alvo, a pedra aparece em cima de mim. Queria que quando ao usar a trap, as pedras aparecessem somente onde tem "espaço" para elas aparecerem. Exemplo: se tiver algumas pessoas cercando o alvo, as pedras não apareceriam nos SQMs que essas pessoas estão. Vou deixar o SCRIPT que estou usando abaixo. Alguém pode me ajudar pfv? Você tem o código disponível? Se tiver publique-o aqui: local c = { trapId = 2718, -- id do trap trapTime = 4, -- tempo do trap em segundos exhaustStorage = 1060602, -- storage do exhausted exhaustTime = 20 -- tempo do exhausted em segundos } local trap = createCombatObject() setCombatArea(trap, createCombatArea({ {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,1,1,1,0,0}, {0,0,1,2,1,0,0}, {0,0,1,1,1,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0} })) function onTargetTile(cid, pos) doCreateItem(c.trapId, 1, pos) addEvent(function() local thing = getTileItemById(pos, c.trapId).uid if(thing ~= 0) then doRemoveItem(thing) end end, c.trapTime * 1000) end setCombatCallback(trap, CALLBACK_PARAM_TARGETTILE, "onTargetTile") function onCastSpell(cid, var) local target = variantToNumber(var) if(isPlayer(cid)) then if(math.max(0, (exhaustion.get(cid, c.exhaustStorage) or 0)) > 0) then doPlayerSendCancel(cid, "You are exhausted. Wait " .. exhaustion.get(cid, c.exhaustStorage) .. " second" .. (exhaustion.get(cid, c.exhaustStorage) > 1 and "s" or "") .. ".") return false else exhaustion.set(cid, c.exhaustStorage, c.exhaustTime) end end local effeito1 = {x=getThingPosition(getCreatureTarget(cid)).x-1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z} local effeito2 = {x=getThingPosition(getCreatureTarget(cid)).x-1, y=getThingPosition(getCreatureTarget(cid)).y-1, z=getThingPosition(getCreatureTarget(cid)).z} local effeito3 = {x=getThingPosition(getCreatureTarget(cid)).x-1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z} local effeito4 = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z} local effeito5 = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y-1, z=getThingPosition(getCreatureTarget(cid)).z} local effeito6 = {x=getThingPosition(getCreatureTarget(cid)).x, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z} local effeito7 = {x=getThingPosition(getCreatureTarget(cid)).x, y=getThingPosition(getCreatureTarget(cid)).y-1, z=getThingPosition(getCreatureTarget(cid)).z} local effeito8 = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z} doSendMagicEffect(effeito1, 111) doSendMagicEffect(effeito2, 111) doSendMagicEffect(effeito3, 111) doSendMagicEffect(effeito4, 111) doSendMagicEffect(effeito5, 111) doSendMagicEffect(effeito6, 111) doSendMagicEffect(effeito7, 111) doSendMagicEffect(effeito8, 111) doCombat(cid, trap, var) return true end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. WhatsApp_Video_2021-03-30_at_08_38_51.mp4Unavailable @139 Desculpa te marcar irmão, mas se tiver como me ajudar mais uma vez kk. Agradeço desde já! Editado Março 30, 2021 4 anos por raphadoidera (veja o histórico de edições)
Postado Março 31, 2021 4 anos Solução @raphadoidera local c = { trapId = 2718, -- id do trap trapTime = 4, -- tempo do trap em segundos exhaustStorage = 1060602, -- storage do exhausted exhaustTime = 20 -- tempo do exhausted em segundos } local trap = createCombatObject() setCombatArea(trap, createCombatArea({ {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,1,1,1,0,0}, {0,0,1,2,1,0,0}, {0,0,1,1,1,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0} })) function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function onTargetTile(cid, pos) if isWalkable(pos, true, true, true) then doSendMagicEffect(pos, 111) doCreateItem(c.trapId, 1, pos) addEvent(function() local thing = getTileItemById(pos, c.trapId).uid if(thing ~= 0) then doRemoveItem(thing) end end, c.trapTime * 1000) end end setCombatCallback(trap, CALLBACK_PARAM_TARGETTILE, "onTargetTile") function onCastSpell(cid, var) local target = variantToNumber(var) if(isPlayer(cid)) then if(math.max(0, (exhaustion.get(cid, c.exhaustStorage) or 0)) > 0) then doPlayerSendCancel(cid, "You are exhausted. Wait " .. exhaustion.get(cid, c.exhaustStorage) .. " second" .. (exhaustion.get(cid, c.exhaustStorage) > 1 and "s" or "") .. ".") return false else exhaustion.set(cid, c.exhaustStorage, c.exhaustTime) end end doCombat(cid, trap, var) return true end
Postado Março 31, 2021 4 anos Autor Em 31/03/2021 em 00:49, 139 disse: @raphadoidera local c = { trapId = 2718, -- id do trap trapTime = 4, -- tempo do trap em segundos exhaustStorage = 1060602, -- storage do exhausted exhaustTime = 20 -- tempo do exhausted em segundos } local trap = createCombatObject() setCombatArea(trap, createCombatArea({ {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,1,1,1,0,0}, {0,0,1,2,1,0,0}, {0,0,1,1,1,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0} })) function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function onTargetTile(cid, pos) if isWalkable(pos, true, true, true) then doSendMagicEffect(pos, 111) doCreateItem(c.trapId, 1, pos) addEvent(function() local thing = getTileItemById(pos, c.trapId).uid if(thing ~= 0) then doRemoveItem(thing) end end, c.trapTime * 1000) end end setCombatCallback(trap, CALLBACK_PARAM_TARGETTILE, "onTargetTile") function onCastSpell(cid, var) local target = variantToNumber(var) if(isPlayer(cid)) then if(math.max(0, (exhaustion.get(cid, c.exhaustStorage) or 0)) > 0) then doPlayerSendCancel(cid, "You are exhausted. Wait " .. exhaustion.get(cid, c.exhaustStorage) .. " second" .. (exhaustion.get(cid, c.exhaustStorage) > 1 and "s" or "") .. ".") return false else exhaustion.set(cid, c.exhaustStorage, c.exhaustTime) end end doCombat(cid, trap, var) return true end Funcionou irmão, muito obrigado!
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.