Tenaria
New Member
- Joined
- Apr 26, 2009
- Messages
- 142
- Reaction score
- 2
Dear Otland Community,
i tryed to script with my own brain as the thread says an enchant npc or upgrade what ever (iam not even a scripter or someth).
But i get this error (tfs 0.4) :
Basically i want somebody says "Hi", "enchant" he should bring item ID 8300 and 100 cc, and become itemID 8303.
Thanks for your help
i tryed to script with my own brain as the thread says an enchant npc or upgrade what ever (iam not even a scripter or someth).
But i get this error (tfs 0.4) :
Code:
[7:29:06.755] [Error - LuaInterface::loadFile] data/npc/scripts/epicizer.lua:27: unexpected symbol near '='
[7:29:06.759] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/epicizer.lua
[7:29:06.763] data/npc/scripts/epicizer.lua:27: unexpected symbol near '='
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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
item = 8303
noitem = 'Come back when you have full stuff.'
function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, 'enchant') then
selfSay("Do you want upgrade your item?", cid)
if msgcontains (msg, 'yes') then
doPlayerGetItemCount(cid, 8300) = 5 and
doPlayerGetItemCounter(cid, 2160) = 100 then
doPlayerRemoveItem (cid, 8300, 5)
doPlayerRemveItem (cid, 2160, 100)
doPlayerSendMagicEffect (getCreaturePosition(cid), 19)
doPlayerAddItem (cid, 8303, 1)
else
selfSay (noitem)
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Basically i want somebody says "Hi", "enchant" he should bring item ID 8300 and 100 cc, and become itemID 8303.
Thanks for your help