hello i have error when i say a,v,c,bv, g, etc
attempt to index field `?' (a nil value)
attempt to index field `?' (a nil value)
Code:
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
runeLocator = 0
if (msgcontains(msg, 'hi') and (not isFocused(cid))) and getDistanceToCreature(cid) < 4 then
selfSay('Hello ' .. creatureGetName(cid) .. '! I am a special rune seller. I sell "runes" in backpacks. Feel free to ask me about "runes\".',cid)
addFocus(cid)
talk_start = os.clock()
elseif msgcontains(msg, 'runes') and isFandD(cid, 4) then
msg = "I sell runes in backpacks. Just say "
for i=1,getnTable(containerProducts) do
if i == getnTable(containerProducts) - 1 then
ends = " and "
elseif i == getnTable(containerProducts) then
ends = "."
else
ends = ", "
end
msg = msg.."\'bp "..containerProducts[i].name.."\' - ("..((containerProducts[i].pricePerOneRune*containerProducts[i].amountInOneRune*20)/10000).."cc)"..ends
end
selfSay(msg,cid)
elseif isFandD(cid, 4) then
--talk_start = os.clock()
if msgcontains(msg, "bp") then
for i=1,getnTable(containerProducts) do
if msgcontains(msg, containerProducts[i].name) then
runeLocator = i
break
end
end
elseif msgcontains(msg, 'bye') and isFandD(cid, 4) and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!',cid)
removeFocus(cid)
talk_start = 0
move = true
end
if runeLocator == 0 and msgcontains(msg, "bp") then
selfSay('lol u mad?',cid)
else
BuyContainer(cid,containerProducts[runeLocator].runeId,containerProducts[runeLocator].amountInOneRune,(containerProducts[runeLocator].pricePerOneRune*containerProducts[runeLocator].amountInOneRune*20),containerProducts[runeLocator].bpId,1)
end
end
end
Last edited: