tnecniiv
scripter to be
- Joined
- Jan 6, 2012
- Messages
- 298
- Solutions
- 3
- Reaction score
- 25
i get this
[24/01/2014 20:02:18] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/outfiter.lua
[24/01/2014 20:02:18] data/npc/scripts/outfiter.lua:6: function arguments expected near ':'
i am using tfs o.2.14
my script looks like this
[24/01/2014 20:02:18] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/outfiter.lua
[24/01/2014 20:02:18] data/npc/scripts/outfiter.lua:6: function arguments expected near ':'
i am using tfs o.2.14
my script looks like this
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local configs = {
ItemId = 10134,
ItemCount = 1,
Storage = 15200,
}
if(msgcontains(msg, 'outfit')) then
if (getPlayerStorageValue(cid, configs.Storage) > 0) then
selfSay('You already have this outfit.', cid)
talkState[talkUser] = 0
else
selfSay('Do you have all the items for the new outfit ?', cid)
talkState[talkUser] = 1
end
else
if(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if (getPlayerItemCount(cid, configs.ItemId) == configs.ItemCount) then
doPlayerRemoveItem(cid, configs.ItemId, configs.ItemCount)
setPlayerStorageValue(cid, configs.Storage, 1)
doPlayerAddOutfit(cid, xxx)
doSendMagicEffect(getPlayerPosition(cid), 12)
selfSay('Congratz, you now have a brand new outfit.', cid)
talkState[talkUser] = 0
else
selfSay('You don\'t have all the items.', cid)
talkState[talkUser] = 0
end
end
return TRUE
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())