Ir para conteúdo

Posts Recomendados

Daew galera aqui to eu mais uma ves dessa ves vou postar um npc que ataca players Pks

bom para ots de poca xp!!!

 

bem abra o bloco de notas e escreva isso!!!

 

local target = 0

local prevTarget = 0

local maxChaseDistance = 20

local origPos = 0

local lastAttack = 0

local followTimeout = 10

 

local function isSkulled(cid)

if(getPlayerSkullType(cid) >= 3 and isPlayerPzLocked(cid) == TRUE) then

return true

end

 

return false

end

 

local function goToOrigPos()

target = 0

lastAttack = 0

selfFollow(0)

doTeleportThing(getNpcCid(), origPos)

end

 

local function updateTarget()

if(isPlayer(target) == FALSE) then

goToOrigPos()

elseif(not isSkulled(target)) then

selfSay("Now, behave in the future.")

goToOrigPos()

end

 

if(target == 0) then

local list = getSpectators(getNpcPos(), 9, 9, false)

for i = 1, table.getn(list) do

local _target = list

if(_target ~= 0) then

if(isPlayer(_target) == TRUE and isSkulled(_target)) then

if(getTilePzInfo(getCreaturePosition(_target)) == FALSE) then

if(selfFollow(_target)) then

target = _target

if(target ~= prevTarget) then

selfSay("Não vou tolerar oq vc acaba de fazer com esse player!")

end

 

prevTarget = target

break

end

end

end

end

end

end

end

 

function onCreatureAppear(cid)

if(cid == getNpcCid()) then

origPos = getNpcPos()

end

end

 

function onCreatureDisappear(cid)

if(cid == target) then

goToOrigPos()

end

end

 

function onCreatureMove(creature, oldPos, newPos)

--

end

 

function onThink()

updateTarget()

 

if(target == 0) then

return

end

 

local playerPos = getCreaturePosition(target)

local myPos = getNpcPos()

 

if(myPos.z ~= playerPos.z) then

goToOrigPos()

return

end

 

if(math.abs(myPos.x - origPos.x) > maxChaseDistance or math.abs(myPos.y - origPos.y) > maxChaseDistance) then

selfSay("I'll catch you next time.")

goToOrigPos()

return

end

 

if(lastAttack == 0) then

lastAttack = os.clock()

end

 

if(os.clock() - lastAttack > followTimeout) then

selfSay("You got me this time, but just wait.")

goToOrigPos()

return

end

 

if((math.abs(playerPos.x - myPos.x) <= 1) and (math.abs(playerPos.y - myPos.y) <= 1)) then

doTargetCombatHealth(getNpcCid(), target, COMBAT_LIFEDRAIN, -500, -800, CONST_ME_EXPLOSIONAREA)

lastAttack = os.clock()

end

end

 

salve isso como policial.lua nas pasta scripts dos npcs

agora vamus fazer o npc funcionar

 

escreva isso no bloco de notas outro bloco!!!

 

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Policia do Ot" script="data/npc/scripts/policial.lua" walkinterval="2000" floorchange="0">

<health now="100" max="100"/>

<look type="134" head="79" body="86" legs="114" feet="0" addons="3"/>

</npc>

 

salve como policial.xml na pasta npcs

agora abra seu ot e escreve: /n policial

se der serto comente

se n der add msn para duvidas:

daian_pcni@hotmail.com

 

2045253.gif

 

click aq para me dar um Level!

Editado por Daianpcni
Link para o comentário
https://xtibia.com/forum/topic/123083-npcs-npc-policial/
Compartilhar em outros sites

  • 8 months later...
  • 2 weeks later...

R.I.D.I.C.U.L.O.

 

Este script foi postando no OTFans fas maior tempão...

Já vi gente postando em tudo quanto é canto, agora dizer que foi você ?

Sinceramente, desmerecer o trabalho de um script é simplismente RIDICULO.

 

Olha bem, você nem fazer uma quote para colocar o script sabe --'

 

Se você é scripter mesmo como diz, me diga qual é a função da maxChaseDistance, ou

da função goToOrigPos (Sem ser a parte de ir pra posição original -.-).

 

REPORTADO.

Link para o comentário
https://xtibia.com/forum/topic/123083-npcs-npc-policial/#findComment-917766
Compartilhar em outros sites

  • 5 months later...

Geralmente só gosto de olhar os tópicos. Nunca respondo. Mas depois de ver essa mensagem, vou ter que zuar.

 

QUOTElocal target = 0

local prevTarget = 0

local maxChaseDistance = 20

local origPos = 0

local lastAttack = 0

local followTimeout = 10

 

IUASDIUASHDIUHASDIUHAISDAHSDUAHSDIUAHSDIUHASIDUHAUDASD,

ri muito quando vi.

 

Concordo plenamente com Linkay

D:

Link para o comentário
https://xtibia.com/forum/topic/123083-npcs-npc-policial/#findComment-991664
Compartilhar em outros sites

  • 1 month later...
  • 9 months later...
  • 2 weeks later...
  • 4 weeks later...

Script mais feio !!

COLOQUE OS DEVIDOS CREDITOS...

 

e outra, você pode ter editado, a fala do npc no caso, e ainda com erro de português =

selfSay("Não vou tolerar oq vc acaba de fazer com esse player!")

end

Procure tutoriais sobre = Aprender sobre script e os significados.. please ta feio a coisa ae !!

Apenas tentando te ajudar garotinhoo...

 

Veja meus trabalhos =

 

http://www.xtibia.co...12#entry1202512 --> Atirar no tibia, com armas do cs.

http://www.xtibia.co...54#entry1203654 --> Npc bank português

 

Editado por NeetoxDz
Link para o comentário
https://xtibia.com/forum/topic/123083-npcs-npc-policial/#findComment-1204247
Compartilhar em outros sites

  • 2 months later...
×
×
  • Criar Novo...