• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Npc problem, please help! rep++

Liikuid

Spin Machine!
Joined
Jul 17, 2010
Messages
257
Reaction score
24
Location
Iquique, Chile
in console say EXPECTED NEAR "<" "then"

PHP:
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 
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, 'quest')) then 
selfSay('Tengo unas 4 misiones por ahora para ti que son las siguiente, {Wayfarer Outfit}, {Draken Boots}, {Royal Scale Robe}, {Exeterator Staff}', cid) --This is just an example, In this script added 4 mission for you ;) 
end 
if(msgcontains(msg, 'Wayfarer Full Outfit')) then
selfSay('Bien para esta mision necesitas lo siguiente, {100 Piece of all cloths, 100 Demon Dust, Zaoan Set, y tener completada la quest de Dragodas}, si ya los tienes diga {The Wayfarer}.', cid) 
talkState[talkUser] = 1
elseif(msgcontains(msg, 'Draken Boots')) then  
selfSay('Bien tu mision necesitas lo siguiente, {200 Piece of Blue and Red Piece of Cloths, 100 Iron Ores, 10 Steel Boots y matar a Draken Exceterator 10 veces.}, si ya tienes lo que te pedi solo diga {The Boots}.', cid) 
talkState[talkUser] = 2
elseif(msgcontains(msg, 'Royal Scale Robe')) then  
selfSay('Bien tu mision es traerme los siguiente materiales, {100 Green and Red Dragon Scale, 100 Green and Red Dragon Leather, 100 Winter wolf Fur, 10 Gold Ingot, 10 Blue Robes, 20 Mammoth fur Cape, 1 Dark lord Cape}, si ya los tienes diga {The Robe}.', cid) 
talkState[talkUser] = 3
elseif(msgcontains(msg, 'Exeterator Staff')) then  
selfSay('Bien para este Staff solo necesitas matar {300 Draken Spellweaver}, si ya lo hiciste diga {The Staff}.', cid) 
talkState[talkUser] = 4

elseif (getPlayerStorageValue(cid,710) == 1) then 
selfSay('Ya has completado esta mision!.', cid) 
talkState[talkUser] = 1

elseif (getPlayerStorageValue(cid,711) == 1) then 
selfSay('Ya has completado esta mision!.', cid) 
talkState[talkUser] = 2

elseif (getPlayerStorageValue(cid,712) == 1) then 
selfSay('Ya has completado esta mision!.', cid) 
talkState[talkUser] = 3 

elseif (getPlayerStorageValue(cid,713) == 1) then 
selfSay('Ya has completado esta mision!.', cid) 
talkState[talkUser] = 4  

--------------------------------------- 
elseif(msgcontains(msg, 'the wayfarer') and talkState[talkUser] == 1) then 
if(doPlayerRemoveItem(cid, 5909, 100) == TRUE) and (doPlayerRemoveItem(cid, 5910, 100) == TRUE) and (doPlayerRemoveItem(cid, 5911, 100) == TRUE) and (doPlayerRemoveItem(cid, 5912, 100) == TRUE) and (doPlayerRemoveItem(cid, 5913, 100) == TRUE) and (doPlayerRemoveItem(cid, 5914, 100) and (doPlayerRemoveItem(cid, 5906, 100) == TRUE) and (doPlayerRemoveItem(cid, 11295, 1) == TRUE) and (doPlayerRemoveItem(cid, 11296, 1) == TRUE) and (doPlayerRemoveItem(cid, 11297, 1) == TRUE) and (doPlayerRemoveItem(cid, 11298, 1) == TRUE) then 
setPlayerStorageValue(cid,710,1)
doPlayerAddOutfit(cid,366,3)
doPlayerAddOutfit(cid,367,3)
selfSay('Bueno ahi tienes tu Outfit Full!.', cid) 
talkState[talkUser] = 0 
else 
selfSay('No tienes lo que te pedi, que es {100 Piece of all cloths, 100 Demon Dust, Zaoan Set, y tener completada la quest de Dragodas}.', cid) 
end
--------------------------------------- 
elseif(msgcontains(msg, 'the boots') and talkState[talkUser] == 2) then 
if(doPlayerRemoveItem(cid, 5911, 200) == TRUE) and (doPlayerRemoveItem(cid, 5912, 200) == TRUE) and (doPlayerRemoveItem(cid, 5880, 100) == TRUE) and (doPlayerRemoveItem(cid, 9971, 10) == TRUE) and (doPlayerRemoveItem(cid, 2645, 10) == TRUE) and getPlayerStorageValue(cid,76672) == 3) then 
setPlayerStorageValue(cid,711,1) 
doPlayerAddItem(cid,12607,1) 
selfSay('Gracias, ahi tienes tu recompensa!.', cid) 
talkState[talkUser] = 0 
else 
selfSay('No tienes lo que te pedi, que es {200 Blue and Red Piece of Cloths, 100 Iron Ores, 10 Steel Boots, 10 Gold Ingot y matar a Draken Exceterator 10 veces}.', cid)
end 
--------------------------------------- 
elseif(msgcontains(msg, 'the robe') and talkState[talkUser] == 3) then 
if(doPlayerRemoveItem(cid, 5882, 100) == TRUE) and (doPlayerRemoveItem(cid, 5920, 100) == TRUE) and (doPlayerRemoveItem(cid, 5948, 100) == TRUE) and (doPlayerRemoveItem(cid, 5877, 100) == TRUE) and (doPlayerRemoveItem(cid, 11206, 100) == TRUE) and (doPlayerRemoveItem(cid, 9971, 10) == TRUE) and (doPlayerRemoveItem(cid, 7463, 10) == TRUE) and (doPlayerRemoveItem(cid, 8865, 2) == TRUE) then
setPlayerStorageValue(cid,712,1) 
doPlayerAddItem(cid,12607,1)  
selfSay('Se valora tu esfuerzo, ahi tienes tu recompensa!.', cid) 
talkState[talkUser] = 0 
else 
selfSay('No tienes lo que te pedi, que es {100 Green and Red Dragon Scale, 100 Green and Red Dragon Leather, 100 Winter wolf Fur, 10 Gold Ingot, 10 Blue Robes, 10 Mammoth fur Cape, 2 Dark lord Cape}.', cid) 
end 
--------------------------------------- 
elseif(msgcontains(msg, 'the staff') and talkState[talkUser] == 4) then
if(getPlayerStorageValue(cid,78000) == 3) then 
setPlayerStorageValue(cid,713,1) 
doPlayerAddItem(cid,12609,1)   
selfSay('Gracias, ahi tienes tu premio!.', cid) 
talkState[talkUser] = 0 
else 
selfSay('No tienes lo que te pedi, que es {matar 300 Draken Spellweaver}.', cid) 
end 
------------------------------------------ 

end 
end     
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())

what's wrong?

rep++!!

thx alot
 
Last edited:
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 
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, 'quest')) then 
selfSay('Tengo unas 4 misiones por ahora para ti que son las siguiente, {Wayfarer Outfit}, {Draken Boots}, {Royal Scale Robe}, {Exeterator Staff}', cid) --This is just an example, In this script added 4 mission for you ;) 
end 
if(msgcontains(msg, 'Wayfarer Full Outfit')) then
selfSay('Bien para esta mision necesitas lo siguiente, {100 Piece of all cloths, 100 Demon Dust, Zaoan Set, y tener completada la quest de Dragodas}, si ya los tienes diga {The Wayfarer}.', cid) 
talkState[talkUser] = 1
elseif(msgcontains(msg, 'Draken Boots')) then  
selfSay('Bien tu mision necesitas lo siguiente, {200 Piece of Blue and Red Piece of Cloths, 100 Iron Ores, 10 Steel Boots y matar a Draken Exceterator 10 veces.}, si ya tienes lo que te pedi solo diga {The Boots}.', cid) 
talkState[talkUser] = 2
elseif(msgcontains(msg, 'Royal Scale Robe')) then  
selfSay('Bien tu mision es traerme los siguiente materiales, {100 Green and Red Dragon Scale, 100 Green and Red Dragon Leather, 100 Winter wolf Fur, 10 Gold Ingot, 10 Blue Robes, 20 Mammoth fur Cape, 1 Dark lord Cape}, si ya los tienes diga {The Robe}.', cid) 
talkState[talkUser] = 3
elseif(msgcontains(msg, 'Exeterator Staff')) then  
selfSay('Bien para este Staff solo necesitas matar {300 Draken Spellweaver}, si ya lo hiciste diga {The Staff}.', cid) 
talkState[talkUser] = 4

elseif (getPlayerStorageValue(cid,710) == 1) then 
selfSay('Ya has completado esta mision!.', cid) 
talkState[talkUser] = 1

elseif (getPlayerStorageValue(cid,711) == 1) then 
selfSay('Ya has completado esta mision!.', cid) 
talkState[talkUser] = 2

elseif (getPlayerStorageValue(cid,712) == 1) then 
selfSay('Ya has completado esta mision!.', cid) 
talkState[talkUser] = 3 

elseif (getPlayerStorageValue(cid,713) == 1) then 
selfSay('Ya has completado esta mision!.', cid) 
talkState[talkUser] = 4  

--------------------------------------- 
elseif(msgcontains(msg, 'the wayfarer') and talkState[talkUser] == 1) then 
if(doPlayerRemoveItem(cid, 5909, 100) == TRUE) and (doPlayerRemoveItem(cid, 5910, 100) == TRUE) and (doPlayerRemoveItem(cid, 5911, 100) == TRUE) and (doPlayerRemoveItem(cid, 5912, 100) == TRUE) and (doPlayerRemoveItem(cid, 5913, 100) == TRUE) and (doPlayerRemoveItem(cid, 5914, 100) and (doPlayerRemoveItem(cid, 5906, 100) == TRUE) and (doPlayerRemoveItem(cid, 11295, 1) == TRUE) and (doPlayerRemoveItem(cid, 11296, 1) == TRUE) and (doPlayerRemoveItem(cid, 11297, 1) == TRUE) and (doPlayerRemoveItem(cid, 11298, 1) == TRUE)) then 
setPlayerStorageValue(cid,710,1)
doPlayerAddOutfit(cid,366,3)
doPlayerAddOutfit(cid,367,3)
selfSay('Bueno ahi tienes tu Outfit Full!.', cid) 
talkState[talkUser] = 0 
else 
selfSay('No tienes lo que te pedi, que es {100 Piece of all cloths, 100 Demon Dust, Zaoan Set, y tener completada la quest de Dragodas}.', cid) 
end
--------------------------------------- 
elseif(msgcontains(msg, 'the boots') and talkState[talkUser] == 2) then 
if(doPlayerRemoveItem(cid, 5911, 200) == TRUE) and (doPlayerRemoveItem(cid, 5912, 200) == TRUE) and (doPlayerRemoveItem(cid, 5880, 100) == TRUE) and (doPlayerRemoveItem(cid, 9971, 10) == TRUE) and (doPlayerRemoveItem(cid, 2645, 10) == TRUE) and getPlayerStorageValue(cid,76672) == 3 then 
setPlayerStorageValue(cid,711,1) 
doPlayerAddItem(cid,12607,1) 
selfSay('Gracias, ahi tienes tu recompensa!.', cid) 
talkState[talkUser] = 0 
else 
selfSay('No tienes lo que te pedi, que es {200 Blue and Red Piece of Cloths, 100 Iron Ores, 10 Steel Boots, 10 Gold Ingot y matar a Draken Exceterator 10 veces}.', cid)
end 
--------------------------------------- 
elseif(msgcontains(msg, 'the robe') and talkState[talkUser] == 3) then 
if(doPlayerRemoveItem(cid, 5882, 100) == TRUE) and (doPlayerRemoveItem(cid, 5920, 100) == TRUE) and (doPlayerRemoveItem(cid, 5948, 100) == TRUE) and (doPlayerRemoveItem(cid, 5877, 100) == TRUE) and (doPlayerRemoveItem(cid, 11206, 100) == TRUE) and (doPlayerRemoveItem(cid, 9971, 10) == TRUE) and (doPlayerRemoveItem(cid, 7463, 10) == TRUE) and (doPlayerRemoveItem(cid, 8865, 2) == TRUE) then
setPlayerStorageValue(cid,712,1) 
doPlayerAddItem(cid,12607,1)  
selfSay('Se valora tu esfuerzo, ahi tienes tu recompensa!.', cid) 
talkState[talkUser] = 0 
else 
selfSay('No tienes lo que te pedi, que es {100 Green and Red Dragon Scale, 100 Green and Red Dragon Leather, 100 Winter wolf Fur, 10 Gold Ingot, 10 Blue Robes, 10 Mammoth fur Cape, 2 Dark lord Cape}.', cid) 
end 
--------------------------------------- 
elseif(msgcontains(msg, 'the staff') and talkState[talkUser] == 4) then
if(getPlayerStorageValue(cid,78000) == 3) then 
setPlayerStorageValue(cid,713,1) 
doPlayerAddItem(cid,12609,1)   
selfSay('Gracias, ahi tienes tu premio!.', cid) 
talkState[talkUser] = 0 
else 
selfSay('No tienes lo que te pedi, que es {matar 300 Draken Spellweaver}.', cid) 
end 
------------------------------------------ 

end 
end     
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())
 
Back
Top