Hello i found a npc script before, is works good. But i need to make it possible to upgrade one more item and wounder is any one can help me?
removeitem1 = 2308, --VIP SD
removeitem2 = 9636, --VIP SD Updrage
prizeitem = 2284 --Ultimate SD
REP! ++
removeitem1 = 2308, --VIP SD
removeitem2 = 9636, --VIP SD Updrage
prizeitem = 2284 --Ultimate SD
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}
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
local otswe = {
removeitem1 = 2267, --Survival Rune
removeitem2 = 11198, --Upgrader
prizeitem = 2265 --Ultimate Survival Rune
}
function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
if msgcontains(msg, 'help') or msgcontains(msg, 'survival rune') or msgcontains(msg, 'upgrade') then
npcHandler:say('Hello i can upgrade your Survival Rune.', cid)
npcHandler:say('Do you want to upgrade? {yes}.', cid)
elseif(msgcontains(msg, 'yes')) then
if doPlayerRemoveItem(cid, otswe.removeitem1, 1) and doPlayerRemoveItem(cid, otswe.removeitem2, 1) then
npcHandler:say('Thank you!', cid)
doPlayerAddItem(cid,otswe.prizeitem,1)
focus = 0
else
npcHandler:say('Are you kidding me ? I dont see any survival upgrader or survival rune with you! You didn\'t get them! Grrr... come back when you\'ve got them.', cid)
end
end
return true
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
REP! ++