Hello.
As you can speak with NPCs even few sqms away then you can setup MAX_DIST_NPC according to your needs. So if for some reason you need to actually need to stand right next to it then you can setup MAX_DIST_NPC = 1.
It will play sound, flash client and print on Console tab if it cannot find the npc or could not reach the npc.
local NAME = 'npc name'
local MAX_DIST_NPC = 2
local creatureDistance = findcreature(NAME)
while creatureDistance > MAX_DIST_NPC do
if not reachcreature(NAME) then
break
end
creatureDistance = findcreature(NAME)
end
if creatureDistance == -1 then
playsound('default')
flashclient()
print('Could not find creature ' .. NAME)
elseif creatureDistance > MAX_DIST_NPC then
playsound('default')
flashclient()
print('Failed to reach creature ' .. NAME)
else
say('hi')
wait(500, 800)
say('spiritual shielding')
wait(500, 800)
say('yes')
wait(500, 800)
end