So the npc is supposed to repair softies or firewalker boots depending on what player chooses
So, I'm having 2 problems.
The first one is this:
Second is that when I say firewalker boots the Npc isnt answering.
By the way, how do I make it so I can pay with gold, platinum or crystal?
Cause I put ID of gold, and I could not pay with crystals, I tried with platinums using platinums and I could but I couldn't with crystals though.
Thanks and rep+ for whoever helps!
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
function creatureSayCallback(cid, type, msg)
local stuff = {
[1] = {name = 'soft boots', price = 10, worn = 6530, ID = 6132, nr = 1},
[2] = {name = 'firewalker boots', price = 10, worn = 9934, ID = 9932, nr = 2}
}
local v = doPlayerRemoveItem
local s = getPlayerItemCount
for i = 1, #stuff do
if (msgcontains(msg, stuff[i].name)) then
npcHandler:say('Estas seguro que quieres reaparar tus " .. stuff[i].name .. " ?',cid)
Topic[cid] = stuff[i].nr
elseif msgcontains(msg, 'yes') and v(cid,stuff[i].worn,1) and v(cid,2152,stuff[i].price) and Topic[cid] == stuff[i].nr then
npcHandler:say('Aqui tienes', cid)
doPlayerAddItem(cid,stuff[i].ID,1)
Topic[cid] = 0
elseif msgcontains(msg, 'yes') and s(cid,2152) < stuff[i].price and Topic[cid] == stuff[i].nr then
npcHandler:say('No dispones de suficiente dinero',cid)
Topic[cid] = 0
elseif msgcontains(msg, 'yes') and s(cid,stuff[i].worn) < 1 and Topic[cid] == stuff[i].nr then
npcHandler:say('No tienes unas worn " .. stuff[i].name .. " ',cid)
Topic[cid] = 0
elseif msgcontains(msg, 'no') and Topic[cid] == stuff[i].nr then
npcHandler:say('En otra ocasion entonces', cid)
Topic[cid] = 0
end
return true
end
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
So, I'm having 2 problems.
The first one is this:
00:04 Admin Santi [156]: hi
00:04 Baba: Hola Admin Santi. yo reparo soft boots y firewalker boots!.
00:04 Admin Santi [156]: soft boots
00:04 Baba: Estas seguro que quieres reaparar tus " .. stuff?i?.name .. " ?
Second is that when I say firewalker boots the Npc isnt answering.
By the way, how do I make it so I can pay with gold, platinum or crystal?
Cause I put ID of gold, and I could not pay with crystals, I tried with platinums using platinums and I could but I couldn't with crystals though.
Thanks and rep+ for whoever helps!