szajker123
New Member
- Joined
- May 12, 2012
- Messages
- 195
- Reaction score
- 0
Hi, I found the forum script that after giving the NPC gives itemu item / only I've done features
only that something does not work when I have 10 items of this writing
but i need here with 10 items ..
Does anyone help? REP + + + for your help!
here's the entire script
PHP:
doPlayerAddLevel(cid, 1, round)
PHP:
selfSay('You dont have enought tokens!', cid)
PHP:
if getPlayerItemCount(cid,1) >= 10 then
doPlayerRemoveItem(cid,11877,10)
here's the entire script
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() 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
if(msgcontains(msg, 'lvl') or msgcontains(msg, '10 meat')) then
if getPlayerItemCount(cid,1) >= 10 then
doPlayerRemoveItem(cid,11877,10)
selfSay('Okey, here you are!', cid)
doPlayerAddLevel(cid, 1, round)
talkState[talkUser] = 0
else
selfSay('You dont have enought tokens!', cid)
talkState[talkUser] = 0
end
elseif(msgcontains(msg, 'offer')) then
selfSay('Here is my offer:', cid)
selfSay('10 tokens = lvl', cid)
selfSay('15 tokens = lvl', cid)
selfSay('20 tokens = lvl', cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Last edited: