LU

Erro Action Removecreature

Por Lucaswc15, 20 de mai. de 2012 em Scripts

script
10
1.2k
Lucaswc15L
20 de maio de 2012 às 19:42

Tem um erro nessa action, ela nao remove o monstro

aqui vai o script

 

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

 

 

local fromPosimperador = {x=392, y=524, z=8}

local toPosimperador = {x=397, y=527, z=8}

local monsterimperador = getThingfromPos(fromPosimperador, toPosimperador)

 

if isInArea(getPlayerPosition(cid), fromPosimperador, toPosimperador) then

if getPlayerStorageValue(cid,2566) == 4 then

doTeleportThing(cid,{x=395,y=525,z=8})

doSendMagicEffect(getPlayerPosition(cid), 10)

 

doCreatureSay(cid, "Voc\ê est\á viajando no tempo",TALKTYPE_ORANGE_1)

setPlayerStorageValue(cid,2566,5)

else

 

if getPlayerStorageValue(cid,2566) == 6 then

doTeleportThing(cid,{x=395,y=525,z=8})

doSendMagicEffect(getPlayerPosition(cid), 10)

 

doCreatureSay(cid, "Voc\ê est\á viajando no tempo",TALKTYPE_ORANGE_1)

setPlayerStorageValue(cid,2566,7)

 

if(isPlayer(monsterimperador.uid) == TRUE)then

doRemoveCreature(monsterimperador.uid)

return true

 

end

return true

 

end

return true

 

end

return true

 

end

return true

 

end

Makelin1M
20 de maio de 2012 às 19:51

Teste ai

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

 

 

local fromPosimperador = {x=392, y=524, z=8}

local toPosimperador = {x=397, y=527, z=8}

local monsterimperador = getThingfromPos(fromPosimperador, toPosimperador)

 

if isInArea(getPlayerPosition(cid), fromPosimperador, toPosimperador) then

if getPlayerStorageValue(cid,2566) == 4 then

doTeleportThing(cid,{x=395,y=525,z=8})

doSendMagicEffect(getPlayerPosition(cid), 10)

 

doCreatureSay(cid, "Voc\ê est\á viajando no tempo",TALKTYPE_ORANGE_1)

setPlayerStorageValue(cid,2566,5)

else

 

if getPlayerStorageValue(cid,2566) == 6 then

doTeleportThing(cid,{x=395,y=525,z=8})

doSendMagicEffect(getPlayerPosition(cid), 10)

 

doCreatureSay(cid, "Voc\ê est\á viajando no tempo",TALKTYPE_ORANGE_1)

setPlayerStorageValue(cid,2566,7)

 

if(isPlayer(monsterimperador.uid) == TRUE)then

doRemoveCreature(monsterimperador.cid)

return true

 

end

return true

 

end

return true

 

end

return true

 

end

return true

 

end

Lucaswc15L
20 de maio de 2012 às 19:59

Nao funcionou,

eu quero que remova o bixo!

VodkartV
20 de maio de 2012 às 20:16

veja bem

 

if(isPlayer(monsterimperador.uid) == TRUE)then
doRemoveCreature(monsterimperador.cid)
return true
end

 

está checando se é jogador "isPlayer", se fosse para checar monstro use "isMonster"

Lucaswc15L
20 de maio de 2012 às 20:19

Sim eu tinha trocado, mas mesmo assim nao funcionou, acho que o erro é nessa ordem

 

por causa disso

if isInArea(getPlayerPosition(cid), fromPosimperador, toPosimperador) then

Editado Maio 20 por Lucaswc15

VodkartV
20 de maio de 2012 às 20:26

sim, tente usar

 

for x = fromPosimperador.x, toPosimperador.x do 
for y = fromPosimperador.y, toPosimperador.y do 
local mob = getTopCreature({x=x, y=y, z=8}).uid 
if mob ~= 0 and isMonster(mob) then
doRemoveCreature(mob)
end
end
end

Lucaswc15L
20 de maio de 2012 às 20:32

Estranho, não funcionou

 

ficou assim

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local fromPosimperador = {x=392, y=524, z=8}
local toPosimperador = {x=397, y=527, z=8}
local monsterimperador = getThingfromPos(fromPosimperador, toPosimperador)


if isInArea(getPlayerPosition(cid), fromPosimperador, toPosimperador) then
if getPlayerStorageValue(cid,2566) == 4 then
doTeleportThing(cid,{x=395,y=525,z=8})
doSendMagicEffect(getPlayerPosition(cid), 10)

doCreatureSay(cid, "Voc\ê est\á viajando no tempo",TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid,2566,5)
else

if getPlayerStorageValue(cid,2566) == 6 then
doTeleportThing(cid,{x=395,y=525,z=8})
doSendMagicEffect(getPlayerPosition(cid), 10)
doCreatureSay(cid, "Voc\ê est\á viajando no tempo",TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid,2566,7)
for x = fromPosimperador.x, toPosimperador.x do
for y = fromPosimperador.y, toPosimperador.y do
local mob = getTopCreature({x=x, y=y, z=8}).uid
if mob ~= 0 and isMonster(mob) then
doRemoveCreature(mob)
end
end
return true
end

return true
end
return true
end
return true
end
return true
end

 

 

Tentei tb jogar isso que voce me passou la pra cima pra ver se era nisso o erro, e é sim, pois mesmo assim nao removeu os monsters.

 

 

 

 

Obs: nao precisa de stackpos?

 

Poderia me ajudar nesse script aqui tb?

Editado Maio 20 por Lucaswc15

VodkartV
20 de maio de 2012 às 20:42
function onUse(cid, item, fromPosition, itemEx, toPosition)
local fromPosimperador = {x=392, y=524, z=8}
local toPosimperador = {x=397, y=527, z=8}
if isInArea(getPlayerPosition(cid), fromPosimperador, toPosimperador) then
if getPlayerStorageValue(cid,2566) == 4 then
doTeleportThing(cid,{x=395,y=525,z=8})
doSendMagicEffect(getPlayerPosition(cid), 10)
doCreatureSay(cid, "Voc\ê est\á viajando no tempo",TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid,2566,5)
else
if getPlayerStorageValue(cid,2566) == 6 then
doTeleportThing(cid,{x=395,y=525,z=8})
doSendMagicEffect(getPlayerPosition(cid), 10)
doCreatureSay(cid, "Voc\ê est\á viajando no tempo",TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid,2566,7)
for x = fromPosimperador.x, toPosimperador.x do
for y = fromPosimperador.y, toPosimperador.y do
local mob = getTopCreature({x=x, y=y, z=8}).uid
if mob ~= 0 and isMonster(mob) then
doRemoveCreature(mob)
end
end
end
end
end
end
return true
end

Lucaswc15L
20 de maio de 2012 às 20:46

Vlw Vodkart é isso ae.

 

REP++

 

pode me ajudar no outro script?

CriticalC
20 de maio de 2012 às 21:45

Tópico fechado, dúvida sanada.

 

Atenciosamente, Critical.