Faraonekkk
New Member
- Joined
- Feb 15, 2010
- Messages
- 686
- Reaction score
- 4
the problem is
me: hi
npc: hiho
me: sell mace
npc: error in console
my ItemPlural in modules.lua
If i put in GetItemPlural GetCount or GetItemName everything is okay but its not reading "Sellable shop" ;/
its making me crazy i am tired of this.
me: hi
npc: hiho
me: sell mace
npc: error in console
data/npc/scripts/lib/npcsystem/modules.lua attempt to call global 'GetItemPlural' <a nil value>
my ItemPlural in modules.lua
if(parameters.eventType == SHOPMODULE_SELL_ITEM) then
local msg = module.npcHandler:getMessage(MESSAGE_SELL)
msg = module.npcHandlerarseMessage(msg, parseInfo)
if(module.amount>1) then
module.npcHandler:say(' Do you want to sell ' .. module.amount .. ' ' .. GetItemPlural(getItemIdByName(tmpName)) .. ' for ' .. parameters.cost*module.amount .. ' gold coins?')
elseif tmpName:sub(1,1):upper() == "e" or tmpName:sub(1,1):lower() == "y" or tmpName:sub(1,1):lower() == "u" or tmpName:sub(1,1):lower() == "i" or tmpName:sub(1,1):lower() == "o" or tmpName:sub(1,1):lower() == "a" then
module.npcHandler:say(' Do you want to sell an ' .. tmpName .. ' for ' .. parameters.cost*module.amount .. ' gold coins?')
elseif GetItemPlural(getItemIdByName(tmpName)) == tmpName then
module.npcHandler:say(' Do you want to sell ' .. tmpName .. ' for ' .. parameters.cost*module.amount .. ' gold coins? ')
else
module.npcHandler:say(' Do you want to sell a ' .. tmpName .. ' for ' .. parameters.cost*module.amount .. ' gold coins?')
end
elseif(parameters.eventType == SHOPMODULE_BUY_ITEM) then
local msg = module.npcHandler:getMessage(MESSAGE_BUY)
msg = module.npcHandlerarseMessage(msg, parseInfo)
if(module.amount>1) then
module.npcHandler:say(' Do you want to buy ' .. module.amount .. ' ' .. GetItemPlural(getItemIdByName(tmpName)) .. ' for ' .. parameters.cost*module.amount .. ' gold coins?')
elseif tmpName:sub(1,1):upper() == "e" or tmpName:sub(1,1):lower() == "y" or tmpName:sub(1,1):lower() == "u" or tmpName:sub(1,1):lower() == "i" or tmpName:sub(1,1):lower() == "o" or tmpName:sub(1,1):lower() == "a" then
module.npcHandler:say(' Do you want to buy an ' .. tmpName .. ' for ' .. parameters.cost*module.amount .. ' gold coins?')
elseif GetItemPlural(getItemIdByName(tmpName)) == tmpName then
module.npcHandler:say(' Do you want to buy ' .. GetItemPlural(getItemIdByName(tmpName)) .. ' for ' .. parameters.cost*module.amount .. ' gold coins? ')
else
module.npcHandler:say(' Do you want to buy a ' .. tmpName .. ' for ' .. parameters.cost*module.amount .. ' gold coins?')
If i put in GetItemPlural GetCount or GetItemName everything is okay but its not reading "Sellable shop" ;/
its making me crazy i am tired of this.
Last edited: