Se Matar Em X Area Broadcast X

shadizinho
em Lixeira Pública

shadizinho

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 24/09/06Posts: 33

Bom dia, Tade , Noite

estou usando 1 script que eu fiz mas que esta dando erro

Todo monstro ou player que eu mato (não presisa estar na area que eu coloquei,isso acontece no mapa inteiro)

o script funciona e não deixa o player morrer (ele fica com 0 de life, não pode se mecher, mas pode atacar os outros, o mesmo acontece com monstros)

 

function onKill(cid, target, lastHit)

local frompos = {x=32544,y=32395,z=7}

local topos = {x=32555,y=32401,z=7}

if frompos.x <= getThingPos(cid).x and topos.x >= getThingPos(cid).x and frompos.y <= getThingPos(cid).y and topos.y >= getThingPos(cid).y then

if frompos.z and topos.z then

doBroadcastMessage("Está na área.")

end

end

end

 

 

<event type="kill" name="Teste" event="script" value="Teste.lua"/>

 

ja Adicionei no login.lua

Tony

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 25/05/11Posts: 506Gênero: MasculinoChar no Tibia: Loading..

2 Tópicos iguais

 

redperson.pngREPORTADOredperson.png

Vinc

The white fox
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/10/11Posts: 625Gênero: Masculino

usa essa function doAntharaz

(coloque ela no arquivo 050-functions que fica na pasta data/lib)

function emarea(cid,frompos,topos)

if frompos.x <= getThingPos(cid).x and topos.x >= getThingPos(cid).x and frompos.y <= getThingPos(cid).y and topos.y >= getThingPos(cid).y then
   if frompos.z and topos.z then
    if frompos.z >= getThingPos(cid).z and topos.z <= getThingPos(cid).z then
	    return TRUE
    end
   else
   return TRUE
   end
end
return FALSE
end

emtao substitua seu script de matar na tal area por esse

function onKill(cid, target, lastHit)
local frompos = {x=32544,y=32395,z=7}
local topos = {x=32555,y=32401,z=7}
if  emarea(cid,frompos,topos) then
doBroadcastMessage("Está na área.")
end
return TRUE
end

^w^