Tenta assim:
local config = {
playerCount = 3919,
fromPositions = {x = 8858, y = 8468, z = 7}, -- igual que en la talkaction izquierda de arriva
toPositions = {x = 8887, y = 8499, z = 7} -- derecha de abajo
}
local pos = getCreaturePosition(cid)
local 0 = {x = pos.x, y = pos.y - math.random(2,3), z = pos.z, stackpos = 255}
local 1 = {x = pos.x, y = pos.y + math.random(2,3), z = pos.z, stackpos = 255}
local 2 = {x = pos.x - math.random(2,3), y = pos.y, z = pos.z, stackpos = 255}
local 3 = {x = pos.x + math.random(2,3), y = pos.y, z = pos.z, stackpos = 255}
local 4 = {x = pos.x - math.random(2,3), y = pos.y - math.random(2,3), z = pos.z, stackpos = 255}
local 5 = {x = pos.x + math.random(2,3), y = pos.y - math.random(2,3), z = pos.z, stackpos = 255}
local 6 = {x = pos.x + math.random(2,3), y = pos.y + math.random(2,3), z = pos.z, stackpos = 255}
local 7 = {x = pos.x - math.random(2,3), y = pos.y + math.random(2,3), z = pos.z, stackpos = 255}
local Event_Start = 3032
function onStatsChange(cid, attacker, type, combat, value)
if type == STATSCHANGE_HEALTHGAIN or getCreatureHealth(cid) > value then
return true
end
local isInArea = isInArea(getPlayerPosition(cid), config.fromPositions, config.toPositions)
if isInArea and isPlayer(cid) then
if getGlobalStorageValue(config.playerCount) >= 3 then
doTeleportThing(cid, math.random(0,7), false)
doSendMagicEffect(getPlayerPosition(cid), 6)
doSendMagicEffect(getPlayerPosition(cid), 3)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
elseif getGlobalStorageValue(config.playerCount) == 2 then
doTeleportThing(cid, math.random(0,7), false)
doSendMagicEffect(getPlayerPosition(cid), 6)
doSendMagicEffect(getPlayerPosition(cid), 3)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
end
for x = config.fromPositions.x, config.toPositions.x do
for y = config.fromPositions.y, config.toPositions.y do
for z = config.fromPositions.z, config.toPositions.z do
local areapos = {x = x, y = y, z = z, stackpos = 253}
local getMonsters = getThingfromPos(areapos)
if isMonster(getMonsters.uid) then
doRemoveCreature(getMonsters.uid)
end
end
end
end
return false
end
return true
end




info
Grupo: Artesão
Registrado: 10/11/11
Posts: 118
Reputação: +2
tentar obter um ataque que os jogadores são teletransportados 2 ou 3 sql qualquer direção, mas não funciona como eu Hise.
obter este erro:
Eu acho que eu estou errado nestas linhas:
local pos = getCreaturePosition(cid) local 0 = {x = pos.x, y = pos.y - math.random(2,3), z = pos.z, stackpos = 255} local 1 = {x = pos.x, y = pos.y + math.random(2,3), z = pos.z, stackpos = 255} local 2 = {x = pos.x - math.random(2,3), y = pos.y, z = pos.z, stackpos = 255} local 3 = {x = pos.x + math.random(2,3), y = pos.y, z = pos.z, stackpos = 255} local 4 = {x = pos.x - math.random(2,3), y = pos.y - math.random(2,3), z = pos.z, stackpos = 255} local 5 = {x = pos.x + math.random(2,3), y = pos.y - math.random(2,3), z = pos.z, stackpos = 255} local 6 = {x = pos.x + math.random(2,3), y = pos.y + math.random(2,3), z = pos.z, stackpos = 255} local 7 = {x = pos.x - math.random(2,3), y = pos.y + math.random(2,3), z = pos.z, stackpos = 255}y em:
aqui é completa, eu espero que você pode me ajudar
local config = { playerCount = 3919, -- Global storage for counting the players left/entered in the event -- Estas coordenadas deben ser exactamente las misma del script en global event! fromPositions = {x = 8858, y = 8468, z = 7}, -- igual que en la talkaction izquierda de arriva toPositions = {x = 8887, y = 8499, z = 7}, -- derecha de abajo } local pos = getCreaturePosition(cid) local 0 = {x = pos.x, y = pos.y - math.random(2,3), z = pos.z, stackpos = 255} local 1 = {x = pos.x, y = pos.y + math.random(2,3), z = pos.z, stackpos = 255} local 2 = {x = pos.x - math.random(2,3), y = pos.y, z = pos.z, stackpos = 255} local 3 = {x = pos.x + math.random(2,3), y = pos.y, z = pos.z, stackpos = 255} local 4 = {x = pos.x - math.random(2,3), y = pos.y - math.random(2,3), z = pos.z, stackpos = 255} local 5 = {x = pos.x + math.random(2,3), y = pos.y - math.random(2,3), z = pos.z, stackpos = 255} local 6 = {x = pos.x + math.random(2,3), y = pos.y + math.random(2,3), z = pos.z, stackpos = 255} local 7 = {x = pos.x - math.random(2,3), y = pos.y + math.random(2,3), z = pos.z, stackpos = 255} local Event_Start = 3032 function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHGAIN or getCreatureHealth(cid) > value then return true end local isInArea = isInArea(getPlayerPosition(cid), config.fromPositions, config.toPositions) if isInArea and isPlayer(cid) then if getGlobalStorageValue(config.playerCount) >= 3 then doTeleportThing(cid, math.random(0,7), false) doSendMagicEffect(getPlayerPosition(cid), 6) doSendMagicEffect(getPlayerPosition(cid), 3) doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid)) elseif getGlobalStorageValue(config.playerCount) == 2 then doTeleportThing(cid, math.random(0,7), false) doSendMagicEffect(getPlayerPosition(cid), 6) doSendMagicEffect(getPlayerPosition(cid), 3) doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid)) end for x = config.fromPositions.x, config.toPositions.x do for y = config.fromPositions.y, config.toPositions.y do for z = config.fromPositions.z, config.toPositions.z do local areapos = {x = x, y = y, z = z, stackpos = 253} local getMonsters = getThingfromPos(areapos) if isMonster(getMonsters.uid) then doRemoveCreature(getMonsters.uid) end end end end return false end return true endEditado Novembro 20 por beenii