SH

Ajuda No Oncreaturesay 8.5

Por shurtup, 18 de ago. de 2009 em Archived

script
2
398
shurtupS
18 de agosto de 2009 às 13:29

[17/08/2009 22:24:05] Lua Script Error: [Npc interface]

[17/08/2009 22:24:05] data/npc/scripts/defender.lua:onCreatureSay

 

[17/08/2009 22:24:05] data/npc/scripts/defender.lua:40: attempt to call global 'getPlayerHealth' (a nil value)

[17/08/2009 22:24:05] stack traceback:

[17/08/2009 22:24:05] data/npc/scripts/defender.lua:40: in function <data/npc/scripts/defender.lua:38>

 

 

por favor me ajudem"

 

eu estalei um npc guard... no meu ot... mas da esse erro..

ele n fala com ninguem nem atk ... ALGUEM PODE ME AJUDAR?

me falaram que tenho que add algo na npc lib... mas n sei o que oO

por favor me ajudem

 

olha o script oncreaturesay

 

function onCreatureSay(cid, type, msg)

msg = string.lower(msg)

health = getPlayerHealth(cid) - health_left

if ((string.find(msg, '(%a*)hi(%a*)'))) and getDistanceToCreature(cid) < 4 then

selfSay('Hello ' .. creatureGetName(cid) .. '! I am a defender of '..town_name..'.')

doNpcSetCreatureFocus(cid)

focus = 0

end

Editado Agosto 18 por Shurtup

joaohdJ
18 de agosto de 2009 às 13:51

tenta isso aki ó:

 

function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
health = getCreatureHealth(cid) - health_left
if ((string.find(msg, '(%a*)hi(%a*)'))) and getDistanceToCreature(cid) < 4 then
selfSay('Hello ' .. creatureGetName(cid) .. '! I am a defender of '..town_name..'.')
doNpcSetCreatureFocus(cid)
focus = 0
end

 

eu acho que funciona. o problema é que nos ots é assim : getPlayerMana e getCreatureHealth e não getPlayerHealth. Ve se vai ae.

flw