[Warning - NpcScript::NpcScript] Can not load script: Grutgroc Broadbeard.lua
data/npc/scripts/Grutgroc Broadbeard.lua:35: function arguments expected near ':'
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
local function creatureSayCallback(cid, type, msg)
local tabela = {
[2392] = {
name = "Fire Sword",
price = 10000,
ingredients = {[5880] = 90, [5468] = 2, [2406] = 1},
failChance = 10,
timeDone = 2,
}
}
for k, v in pairs(tabela) do
if player:getId(k) then
if player:getMoney(tabela.price) then
if player:getItemCount(tabela.ingredients, tabela.ingredients) then
if math.random(1, 100) > tabela.failchance then
if os.mtime() >= tabela.timeDone then
player:removeMoney(tabela.price)
player:removeItem(tabela.ingredients, tabela.ingredients)
npcHandler:say("Here, your ".. tabela.name ..".", cid)
end
else
npcHandler:say("Sorry, your item broke.", cid)
end
else
npcHandler:say("You don't have ".. tabela.ingredients:item:getName() ..".", cid)
end
else
npcHandler:say("You don't have money.", cid)
end
break
end
end
end
npcHandler:addModule(FocusModule:new())