Justin123456
New Member
- Joined
- Mar 24, 2011
- Messages
- 177
- Reaction score
- 4
I randomly get this Error in my database
Is there any way how to fix it? Because it keeps spamming. Also, here's my Greeter.lua:
I'm using TFS 0.3.6
I'll REP whoever helps me
Code:
[26/06/2012 13:56:48] [Error - Npc interface]
[26/06/2012 13:56:48] data/npc/scripts/greeter.lua:onThink
[26/06/2012 13:56:48] Description:
[26/06/2012 13:56:48] data/npc/scripts/greeter.lua:97: attempt to compare number with nil
[26/06/2012 13:56:48] stack traceback:
[26/06/2012 13:56:48] data/npc/scripts/greeter.lua:97: in function <data/npc/scripts/greeter.lua:89>
Is there any way how to fix it? Because it keeps spamming. Also, here's my Greeter.lua:
Code:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Have fun in VIP Island.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello, ' .. getCreatureName(cid) .. '! Welcome to Train Island go south if you wenna find new hunting zones for hight levels!')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. getCreatureName(cid) .. ' im talking with another player wait for your turn..')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'shovel221') then
buy(cid,2554,getCount(msg),20)
elseif msgcontains(msg, 'backp2ack') then
buy(cid,1988,getCount(msg),10)
elseif msgcontains(msg, 'bp manafluids2') then
buyContainer(cid, 2002, 2006, 7, 2000)
elseif msgcontains(msg, 'manaflui2d') or msgcontains(msg, 'man2a fluid') then
buyFluidContainer(cid,2006,getCount(msg),100,7)
elseif msgcontains(msg, 'lifefl2uid') or msgcontains(msg, 'li2fe fluid') then
buyFluidContainer(cid,2006,getCount(msg),60,10)
elseif msgcontains(msg, 'fishi2ng rod') then
buy(cid,2580,getCount(msg),100)
elseif msgcontains(msg, 'to2rch') then
buy(cid,2050,getCount(msg),2)
elseif msgcontains(msg, 'ro2pe') then
buy(cid,2120,getCount(msg),50)
elseif msgcontains(msg, 'ao2l') then
buy(cid,2173,getCount(msg),10000)
elseif msgcontains(msg, 'via2l') or msgcontains(msg, 'fla2sk') then
sell(cid,2006,getCount(msg),10)
elseif msgcontains(msg, 'obsid2ian knife') or msgcontains(msg, 'kni2fe') then
sell(cid,5908,getCount(msg),10000)
elseif msgcontains(msg, 'bless2ed wooden stake') or msgcontains(msg, 'blesse2d wooden stake') then
sell(cid,5942,getCount(msg),6000)
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Have fun in new hunting Island!')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Have fun in new hunting Island!')
focus = 0
end
end
end
I'm using TFS 0.3.6
I'll REP whoever helps me