CR
pedido

Alguem Ajuda Aqui

Por craigmabbit, 12 de nov. de 2012 em Scripts

10
1.3k
12 de novembro de 2012 às 18:36

essa magia esta passando por cima dos bichos, tem como fazer parar ao invez de passar por cima ?

 

local area = {

{0,0,0},

{0,3,0},

{0,0,0},

}

 

function onDash(cid)

local poslook = getCreatureLookPosition(cid)

poslook.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE

if isWalkable(poslook, false, false, false) then

if not isCreature(getThingfromPos(poslook).uid) then

doMoveCreature(cid, getPlayerLookDirection(cid))

doSendMagicEffect(getPlayerPosition(cid), 2)

return TRUE

else

doMoveCreature(cid, getPlayerLookDirection(cid))

return TRUE

end

end

end

 

 

function onCastSpell(cid, var)

local distance = 8

 

for i = 0, distance do

addEvent(onDash,90*i,cid)

end

return TRUE

end

 

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

DeadpoolD
12 de novembro de 2012 às 18:38

você ta testando como GOD ?

12 de novembro de 2012 às 21:44

mesmo sem ser GOD passa em cima do target/creature

Editado Novembro 12 por craigmabbit

Yan OliveiraY
12 de novembro de 2012 às 21:49

Ve se funciona:

 

 

local area = {

{0,0,0},

{0,3,0},

{0,0,0},

}

 

function onDash(cid)

local poslook = getCreatureLookPosition(cid)

poslook.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE

if isWalkable(poslook, false, false, false) then

if not isCreature(getThingfromPos(poslook).uid) then

doMoveCreature(cid, getPlayerLookDirection(cid))

doSendMagicEffect(getPlayerPosition(cid), 2)

return true

else

doMoveCreature(cid, getPlayerLookDirection(cid))

return true

end

end

end

 

 

function onCastSpell(cid, var)

local distance = 8

 

for i = 0, distance do

addEvent(onDash,90*i,cid)

end

return true

end

 

function isWalkable(pos, creature, proj, pz)

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

 

 

12 de novembro de 2012 às 21:51

ainda ta a mesma coisa

Yan OliveiraY
12 de novembro de 2012 às 21:54

Testa assim agora:

 

 

local area = {

{0,0,0},

{0,3,0},

{0,0,0},

}

 

function onDash(cid)

local poslook = getCreatureLookPosition(cid)

poslook.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE

if isWalkable(poslook, false, false, false) then

if not isCreature(getThingfromPos(poslook).uid) then

doMoveCreature(cid, getPlayerLookDirection(cid))

doSendMagicEffect(getPlayerPosition(cid), 2)

return true

else

doMoveCreature(cid, getPlayerLookDirection(cid))

return true

end

end

end

 

 

function onCastSpell(cid, var)

local distance = 8

 

for i = 0, distance do

addEvent(onDash,90*i,cid)

end

return true

end

 

function isWalkable(pos, creature, proj, pz)

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 true

end

end

end

return false

end

 

 

12 de novembro de 2012 às 21:58

a magia nem funciona com esse e não da erro no console

 

a deu um erro sim, dscp attempt to index locas 'poslook' < a boolean value>

SkyLighS
12 de novembro de 2012 às 22:17

Título irregular

reportado

 

Para a alteração

Yan OliveiraY
13 de novembro de 2012 às 15:04

@craigmabbit

 

tenta assim:

 

 

local area = {

{0,0,0},

{0,3,0},

{0,0,0},

}

 

function onDash(cid)

local poslook = getCreatureLookPosition(cid)

poslook.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE

if isWalkable(poslook, false, false, false) then

if not isCreature(getThingfromPos(poslook).uid) then

doMoveCreature(cid, getPlayerLookDirection(cid))

doSendMagicEffect(getPlayerPosition(cid), 2)

return true

else

doMoveCreature(cid, getPlayerLookDirection(cid))

return true

end

end

end

 

 

function onCastSpell(cid, var)

local distance = 8

 

for i = 0, distance do

addEvent(onDash,90*i,cid)

end

return true

end

 

function isWalkable(pos, creature, proj, pz)

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 true

end

end

end

return true

end

 

 

13 de novembro de 2012 às 17:02

continua a mesma coisa só que agora ta indo até na agua, anda em tile de agua