pucus78
Cookie Monster
- Joined
- Jul 4, 2008
- Messages
- 40
- Reaction score
- 0
This code doesn't work for me. NPC sell key with actionid = 0
Thank you for any help![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
PS. In console server i have error:
luaDoSetItemActionId(). Item not found
Code:
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
..
function sellkey(cid, message, keywords, parameters, node)
local key1 = doPlayerAddItem(cid,2088,1)
if(not npcHandler:isFocused(cid)) then
return false
end
if getPlayerMoney(cid) >= 1 then
doPlayerRemoveMoney(cid, 5)
doSetItemActionId(key1, 4601)
npcHandler:say('Please take it.', cid)
else
npcHandler:say('HEY! You don\'t have money! Stop playing tricks on me or I\'ll give you some extra work!', cid)
end
end
...
local node5 = keywordHandler:addKeyword({'key'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Want buy a key? It\'s cost only 5gp'})
node5:addChildKeyword({'yes'}, sellkey, {npcHandler = npcHandler, onlyFocus = true, reset = true})
npcHandler:addModule(FocusModule:new())
Thank you for any help
PS. In console server i have error:
luaDoSetItemActionId(). Item not found
Last edited: