Kydrai
Então cara, testei o script aqui assim que nem ta ai.
- SCRIPT BY: MARKIIN -
function onStepIn(cid, item, pos, frompos)
local positions = {
{x=68, y=409, z=15},
{x=118, y=409, z=15},
{x=98, y=429, z=15},
{x=68, y=439, z=15},
{x=108, y=439, z=15},
{x=88, y=449, z=15},
{x=78, y=459, z=15},
{x=108, y=459, z=15}
}
local destino = positions[math.random(#positions)]
doTeleportThing(cid, destino, true)
for i=0, 7 do
doSummonCreature("Demon", getPosByDir(destino, i))
end
doSendMagicEffect(getPlayerPosition(cid), 10)
end
quando eu andei no tile ele só me teleporto i deu o seguinte erro no console
[24/04/2010 13:59:00] data/lib/position.lua:51: attempt to index local 'pos' (a number value)
[24/04/2010 13:59:00] stack traceback:
[24/04/2010 13:59:00] data/lib/position.lua:51: in function 'getPosByDir'
[24/04/2010 13:59:00] data/movements/scripts/kingarmor/a1.lua:15: in function <data/movements/scripts/kingarmor/a1.lua:1>
ai tentei o a tag a baixo que tu postou
fico desse jeito
function onStepIn(cid, item, pos, frompos)
local positions = {
{x=68, y=409, z=15},
{x=118, y=409, z=15},
{x=98, y=429, z=15},
{x=68, y=439, z=15},
{x=108, y=439, z=15},
{x=88, y=449, z=15},
{x=78, y=459, z=15},
{x=108, y=459, z=15}
}
local destino = math.random(#positions)
doTeleportThing(cid,positions[destino], true)
doSummonCreature("Demon", {positions.x+1, positions.y, positions.z})
doSummonCreature("Demon", {positions.x-1, positions.y, positions.z})
doSummonCreature("Demon", {positions.x, positions.y+1, positions.z})
doSendMagicEffect(getPlayerPosition(cid), 10)
end
deu esse erro
[24/04/2010 14:05:07] data/movements/scripts/kingarmor/a1.lua:14: attempt to perform arithmetic on field 'x' (a nil value)
[24/04/2010 14:05:07] stack traceback:
[24/04/2010 14:05:07] data/movements/scripts/kingarmor/a1.lua:14: in function <data/movements/scripts/kingarmor/a1.lua:1>
se alguem souber ou que manje disso e poder me ajudar agradeço muito !
Bom final de semana.