Step Records 1 Postado Novembro 1, 2018 Share Postado Novembro 1, 2018 hello all I have a small problem with the script crashes in the console here is such a query Citar [01/11/2018 18:57:55] [Error - LuaScriptInterface::loadFile] data/npc/scripts/Pet.lua:172: 'then' expected near '3' [01/11/2018 18:57:55] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/Pet.lua [01/11/2018 18:57:55] data/npc/scripts/Pet.lua:172: 'then' expected near '=' Skrypt: Citar local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {20} --item->getText() --for line in str:gmatch("[^\r\n]+") do ... end --source getText --source getPetOwner() retorna o nome do Player, getCreaturePet(cid) retorna o NPC <- as duas no npc.cpp local balls = { [2222] = { b = 2222 }, [2224] = { b = 2222 }, [11438] = { b = 11438 }, [11440] = { b = 11438 }, [11442] = { b = 11442 }, [11444] = { b = 11442 }, [2220] = { b = 2220 }, [2227] = { b = 2220 }, [11446] = { b = 11446 }, [11447] = { b = 11446 }, [11448] = { b = 11446 }, [11449] = { b = 11449 }, [11450] = { b = 11449 }, [11451] = { b = 11449 }, [11452] = { b = 11452 }, [11453] = { b = 11452 }, [11454] = { b = 11452 }, [11455] = { b = 11455 }, [11456] = { b = 11455 }, [11457] = { b = 11455 }, [11458] = { b = 11458 }, [11459] = { b = 11458 }, [11460] = { b = 11458 }, } local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false local nomes = { [1] = { nome = "", varItem = "" }, [2] = { nome = "", varItem = "" }, [3] = { nome = "", varItem = "" }, [4] = { nome = "", varItem = "" }, [5] = { nome = "", varItem = "" }, [6] = { nome = "", varItem = "" }, } local numPoke = 2 function onThingMove(creature, thing, oldpos, oldstackpos, item, itemEx) end function getListaPoke(cid) item = getPlayerSlotItem(cid, CONST_SLOT_FEET) pb = balls[item.itemid] if pb ~= nil then varNome = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.") nomes[1] = { nome = varNome, varItem = item.uid } end local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK) doCheckNextBag(cid,bp) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if focus == cid then focus = 0 talk_start = 0 talkState[talkUser] = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) numeros=' 1 2 3 4 5 6 ' local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid msg = msg:lower() if (msgcontains(msg, 'trade')) then if getPetOwner() == getCreatureName(cid) then destino = getPlayerStorageValue(cid, 15999) if destino.len() > 0 then selfSay('Ok Master, I will go Faster that I can') doGoTrade(cid,destino) else selfSay('My Master, I cant go without a target') end end elseif(msgcontains(msg, 'yes')) then petMaster = getPlayerGUIDByName(getPetOwner()) if cid ~= petMaster then if getCreatureName(cid) == getPlayerStorageValue(petMaster, 15999) then doTrade(cid,petMaster) else selfSay('You are not the target.') end end elseif(msgcontains(msg, 'give')) then if getPetOwner() == getCreatureName(cid) then if getPlayerStorageValue(cid, 15997) > 0 then doGiveItems(cid) else selfSay('Master, you dont trade anything yet.') end end end end function onCreatureChangeOutfit(creature) end function doCheckNextBag(container, itemTmp, itemQtd) local itemsInBag = {} local bagEmptySlotCheck = 0 local bagSize = getContainerSize(container.uid) for i = 0, getContainerSize(container.uid)-1 do itemsInBag = getContainerItem(container.uid, i) if itemsInBag.itemid == itemTmp then return 1 end if isItemContainer(itemsInBag.itemid) then if doCheckNextBag(itemsInBag,itemTmp,itemQtd) == 1 then return 1 end end return 0 end function doGoTrade(cid,destino) local function fly(params) if isCreature(params.cid) then if isCreature(getCreaturePet(params.cid)) then if params.dd = 3 then --fazer coisas quando chegar na distância correta doTeleportThing(getCreaturePet(params.cid),getThingPos(getPlayerGUIDByName(destino)), true) doPushCreature(getCreaturePet(params.cid), WEST, 1, 0) selfSay(getPetOwner()..' send me to trade with you') selfSay('Say yes to complete the trade') else dir = getDirectionTo(getThingPos(getCreaturePet(params.cid)), getThingPos(getPlayerGUIDByName(destino))) if dir == NORTHWEST then if math.random(1,100) >= 51 then dir = NORTH else dir = WEST end elseif dir == SOUTHWEST then if math.random(1,100) >= 51 then dir = SOUTH else dir = WEST end elseif dir == SOUTHEAST then if math.random(1,100) >= 51 then dir = SOUTH else dir = EAST end elseif dir == NORTHEAST then if math.random(1,100) >= 51 then dir = NORTH else dir = EAST end end local dir = dir if getCreatureSpeed(getCreaturePet(params.cid)) == 0 then doChangeSpeed(getCreaturePet(params.cid), getCreatureBaseSpeed(getCreaturePet(params.cid))) doPushCreature(getCreaturePet(params.cid), dir, 1, 0) doChangeSpeed(getCreaturePet(params.cid), -getCreatureSpeed(getCreaturePet(params.cid))) else doPushCreature(getCreaturePet(params.cid), dir, 1, 0) doChangeSpeed(getCreaturePet(params.cid), -getCreatureSpeed(getCreaturePet(params.cid))) end end end end end local function speed(params) if isCreature(params.cid) then if isCreature(getCreaturePet(params.cid)) then if getCreatureSpeed(getCreaturePet(params.cid)) == 0 then doChangeSpeed(getCreaturePet(params.cid), getCreatureBaseSpeed(getCreaturePet(params.cid))) end end end end doCreatureSay(cid, "Go and back faster than you can!", 1) for i=1,3 do addEvent(fly, 150*i, {cid = cid, dd = i, destino = destino}) addEvent(speed, ((150*3)+100), {cid = cid}) end end function doTrade(cid,petMaster) items = getPlayerStorageValue(petMaster, 15998) itemNo = items:sub(1,5) itemQtd = items:sub(7,9) totalItens = 1 if getPlayerItemCount(cid,itemNo) >= itemQtd then achados = 1 end items = items:sub(11) while items:len() > 0 do itemNo = items:sub(1,5) itemQtd = items:sub(7,9) totalItens = totalItens + 1 if getPlayerItemCount(cid,itemNo) >= itemQtd then achados = achados + 1 end items = items:sub(11) end if achados == totalItens then items = getPlayerStorageValue(petMaster, 15998) itemNo = items:sub(1,5) itemQtd = items:sub(7,9) removeItem = getPlayerItemById(cid, true, itemNo) doRemoveItem(removeItem,itemQtd) items = items:sub(11) while items:len() > 0 do itemNo = items:sub(1,5) itemQtd = items:sub(7,9) removeItem = getPlayerItemById(cid, true, itemNo) doRemoveItem(removeItem,itemQtd) items = items:sub(11) end setPlayerStorageValue(petMaster, 15997, 1) selfSay('Thank you, Bye') doTeleportThing(getCreaturePet(params.cid),getThingPos(petMaster), true) doPushCreature(getCreaturePet(params.cid), WEST, 1, 0) selfSay('Master, say give to have your items') end end function doGiveItems(cid) storage = getPlayerStorageValue(cid, 15997) if storage > 0 then items = getPlayerStorageValue(cid, 15998) itemNo = items:sub(1,5) itemQtd = items:sub(7,9) tradeItem = doCreateItemEx(itemNo,itemQtd) doPlayerAddItemEx(cid, tradeItem, true) items = items:sub(11) while items:len() > 0 do itemNo = items:sub(1,5) itemQtd = items:sub(7,9) tradeItem = doCreateItemEx(itemNo,itemQtd) doPlayerAddItemEx(cid, tradeItem, true) items = items:sub(11) end setPlayerStorageValue(cid, 15997, 0) setPlayerStorageValue(cid, 15998, 0) setPlayerStorageValue(cid, 15999, '') end end Link para o comentário Compartilhar em outros sites More sharing options...
Marshmello 270 Postado Novembro 1, 2018 Share Postado Novembro 1, 2018 @Step Records Ver ae Spoiler local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {20} --item->getText() --for line in str:gmatch("[^\r\n]+") do ... end --source getText --source getPetOwner() retorna o nome do Player, getCreaturePet(cid) retorna o NPC <- as duas no npc.cpp local balls = { [2222] = { b = 2222 }, [2224] = { b = 2222 }, [11438] = { b = 11438 }, [11440] = { b = 11438 }, [11442] = { b = 11442 }, [11444] = { b = 11442 }, [2220] = { b = 2220 }, [2227] = { b = 2220 }, [11446] = { b = 11446 }, [11447] = { b = 11446 }, [11448] = { b = 11446 }, [11449] = { b = 11449 }, [11450] = { b = 11449 }, [11451] = { b = 11449 }, [11452] = { b = 11452 }, [11453] = { b = 11452 }, [11454] = { b = 11452 }, [11455] = { b = 11455 }, [11456] = { b = 11455 }, [11457] = { b = 11455 }, [11458] = { b = 11458 }, [11459] = { b = 11458 }, [11460] = { b = 11458 }, } local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false local nomes = { [1] = { nome = "", varItem = "" }, [2] = { nome = "", varItem = "" }, [3] = { nome = "", varItem = "" }, [4] = { nome = "", varItem = "" }, [5] = { nome = "", varItem = "" }, [6] = { nome = "", varItem = "" }, } local numPoke = 2 function onThingMove(creature, thing, oldpos, oldstackpos, item, itemEx) end function getListaPoke(cid) item = getPlayerSlotItem(cid, CONST_SLOT_FEET) pb = balls[item.itemid] if pb ~= nil then varNome = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.") nomes[1] = { nome = varNome, varItem = item.uid } end local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK) doCheckNextBag(cid,bp) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if focus == cid then focus = 0 talk_start = 0 talkState[talkUser] = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) numeros=' 1 2 3 4 5 6 ' local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid msg = msg:lower() if (msgcontains(msg, 'trade')) then if getPetOwner() == getCreatureName(cid) then destino = getPlayerStorageValue(cid, 15999) if destino.len() > 0 then selfSay('Ok Master, I will go Faster that I can') doGoTrade(cid,destino) else selfSay('My Master, I cant go without a target') end end elseif(msgcontains(msg, 'yes')) then petMaster = getPlayerGUIDByName(getPetOwner()) if cid ~= petMaster then if getCreatureName(cid) == getPlayerStorageValue(petMaster, 15999) then doTrade(cid,petMaster) else selfSay('You are not the target.') end end elseif(msgcontains(msg, 'give')) then if getPetOwner() == getCreatureName(cid) then if getPlayerStorageValue(cid, 15997) > 0 then doGiveItems(cid) else selfSay('Master, you dont trade anything yet.') end end end end function onCreatureChangeOutfit(creature) end function doCheckNextBag(container, itemTmp, itemQtd) local itemsInBag = {} local bagEmptySlotCheck = 0 local bagSize = getContainerSize(container.uid) for i = 0, getContainerSize(container.uid)-1 do itemsInBag = getContainerItem(container.uid, i) if itemsInBag.itemid == itemTmp then return 1 end if isItemContainer(itemsInBag.itemid) then if doCheckNextBag(itemsInBag,itemTmp,itemQtd) == 1 then return 1 end end return 0 end function doGoTrade(cid,destino) local function fly(params) if isCreature(params.cid) then if isCreature(getCreaturePet(params.cid)) then if params.dd == 3 then --fazer coisas quando chegar na distância correta doTeleportThing(getCreaturePet(params.cid),getThingPos(getPlayerGUIDByName(destino)), true) doPushCreature(getCreaturePet(params.cid), WEST, 1, 0) selfSay(getPetOwner()..' send me to trade with you') selfSay('Say yes to complete the trade') else dir = getDirectionTo(getThingPos(getCreaturePet(params.cid)), getThingPos(getPlayerGUIDByName(destino))) if dir == NORTHWEST then if math.random(1,100) >= 51 then dir = NORTH else dir = WEST end elseif dir == SOUTHWEST then if math.random(1,100) >= 51 then dir = SOUTH else dir = WEST end elseif dir == SOUTHEAST then if math.random(1,100) >= 51 then dir = SOUTH else dir = EAST end elseif dir == NORTHEAST then if math.random(1,100) >= 51 then dir = NORTH else dir = EAST end end local dir = dir if getCreatureSpeed(getCreaturePet(params.cid)) == 0 then doChangeSpeed(getCreaturePet(params.cid), getCreatureBaseSpeed(getCreaturePet(params.cid))) doPushCreature(getCreaturePet(params.cid), dir, 1, 0) doChangeSpeed(getCreaturePet(params.cid), -getCreatureSpeed(getCreaturePet(params.cid))) else doPushCreature(getCreaturePet(params.cid), dir, 1, 0) doChangeSpeed(getCreaturePet(params.cid), -getCreatureSpeed(getCreaturePet(params.cid))) end end end end end local function speed(params) if isCreature(params.cid) then if isCreature(getCreaturePet(params.cid)) then if getCreatureSpeed(getCreaturePet(params.cid)) == 0 then doChangeSpeed(getCreaturePet(params.cid), getCreatureBaseSpeed(getCreaturePet(params.cid))) end end end end doCreatureSay(cid, "Go and back faster than you can!", 1) for i=1,3 do addEvent(fly, 150*i, {cid = cid, dd = i, destino = destino}) addEvent(speed, ((150*3)+100), {cid = cid}) end end function doTrade(cid,petMaster) items = getPlayerStorageValue(petMaster, 15998) itemNo = items:sub(1,5) itemQtd = items:sub(7,9) totalItens = 1 if getPlayerItemCount(cid,itemNo) >= itemQtd then achados = 1 end items = items:sub(11) while items:len() > 0 do itemNo = items:sub(1,5) itemQtd = items:sub(7,9) totalItens = totalItens + 1 if getPlayerItemCount(cid,itemNo) >= itemQtd then achados = achados + 1 end items = items:sub(11) end if achados == totalItens then items = getPlayerStorageValue(petMaster, 15998) itemNo = items:sub(1,5) itemQtd = items:sub(7,9) removeItem = getPlayerItemById(cid, true, itemNo) doRemoveItem(removeItem,itemQtd) items = items:sub(11) while items:len() > 0 do itemNo = items:sub(1,5) itemQtd = items:sub(7,9) removeItem = getPlayerItemById(cid, true, itemNo) doRemoveItem(removeItem,itemQtd) items = items:sub(11) end setPlayerStorageValue(petMaster, 15997, 1) selfSay('Thank you, Bye') doTeleportThing(getCreaturePet(params.cid),getThingPos(petMaster), true) doPushCreature(getCreaturePet(params.cid), WEST, 1, 0) selfSay('Master, say give to have your items') end end function doGiveItems(cid) storage = getPlayerStorageValue(cid, 15997) if storage > 0 then items = getPlayerStorageValue(cid, 15998) itemNo = items:sub(1,5) itemQtd = items:sub(7,9) tradeItem = doCreateItemEx(itemNo,itemQtd) doPlayerAddItemEx(cid, tradeItem, true) items = items:sub(11) while items:len() > 0 do itemNo = items:sub(1,5) itemQtd = items:sub(7,9) tradeItem = doCreateItemEx(itemNo,itemQtd) doPlayerAddItemEx(cid, tradeItem, true) items = items:sub(11) end setPlayerStorageValue(cid, 15997, 0) setPlayerStorageValue(cid, 15998, 0) setPlayerStorageValue(cid, 15999, '') end end Link para o comentário Compartilhar em outros sites More sharing options...
Step Records 1 Postado Novembro 1, 2018 Autor Share Postado Novembro 1, 2018 Citar [01/11/2018 19:44:03] [Error - LuaScriptInterface::loadFile] data/npc/scripts/Pet.lua:342: 'end' expected (to close 'function' at line 143) near '<eof>' [01/11/2018 19:44:03] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/Pet.lua [01/11/2018 19:44:03] data/npc/scripts/Pet.lua:342: 'end' expected (to close 'function' at line 143) near '<eof>' Link para o comentário Compartilhar em outros sites More sharing options...
Marshmello 270 Postado Novembro 1, 2018 Share Postado Novembro 1, 2018 @Step Records Spoiler local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {20} --item->getText() --for line in str:gmatch("[^\r\n]+") do ... end --source getText --source getPetOwner() retorna o nome do Player, getCreaturePet(cid) retorna o NPC <- as duas no npc.cpp local balls = { [2222] = { b = 2222 }, [2224] = { b = 2222 }, [11438] = { b = 11438 }, [11440] = { b = 11438 }, [11442] = { b = 11442 }, [11444] = { b = 11442 }, [2220] = { b = 2220 }, [2227] = { b = 2220 }, [11446] = { b = 11446 }, [11447] = { b = 11446 }, [11448] = { b = 11446 }, [11449] = { b = 11449 }, [11450] = { b = 11449 }, [11451] = { b = 11449 }, [11452] = { b = 11452 }, [11453] = { b = 11452 }, [11454] = { b = 11452 }, [11455] = { b = 11455 }, [11456] = { b = 11455 }, [11457] = { b = 11455 }, [11458] = { b = 11458 }, [11459] = { b = 11458 }, [11460] = { b = 11458 }, } local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false local nomes = { [1] = { nome = "", varItem = "" }, [2] = { nome = "", varItem = "" }, [3] = { nome = "", varItem = "" }, [4] = { nome = "", varItem = "" }, [5] = { nome = "", varItem = "" }, [6] = { nome = "", varItem = "" }, } local numPoke = 2 function onThingMove(creature, thing, oldpos, oldstackpos, item, itemEx) end function getListaPoke(cid) item = getPlayerSlotItem(cid, CONST_SLOT_FEET) pb = balls[item.itemid] if pb ~= nil then varNome = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.") nomes[1] = { nome = varNome, varItem = item.uid } end local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK) doCheckNextBag(cid,bp) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if focus == cid then focus = 0 talk_start = 0 talkState[talkUser] = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) numeros=' 1 2 3 4 5 6 ' local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid msg = msg:lower() if (msgcontains(msg, 'trade')) then if getPetOwner() == getCreatureName(cid) then destino = getPlayerStorageValue(cid, 15999) if destino.len() > 0 then selfSay('Ok Master, I will go Faster that I can') doGoTrade(cid,destino) else selfSay('My Master, I cant go without a target') end end elseif(msgcontains(msg, 'yes')) then petMaster = getPlayerGUIDByName(getPetOwner()) if cid ~= petMaster then if getCreatureName(cid) == getPlayerStorageValue(petMaster, 15999) then doTrade(cid,petMaster) else selfSay('You are not the target.') end end elseif(msgcontains(msg, 'give')) then if getPetOwner() == getCreatureName(cid) then if getPlayerStorageValue(cid, 15997) > 0 then doGiveItems(cid) else selfSay('Master, you dont trade anything yet.') end end end end function onCreatureChangeOutfit(creature) end function doCheckNextBag(container, itemTmp, itemQtd) local itemsInBag = {} local bagEmptySlotCheck = 0 local bagSize = getContainerSize(container.uid) for i = 0, getContainerSize(container.uid)-1 do itemsInBag = getContainerItem(container.uid, i) if itemsInBag.itemid == itemTmp then return 1 end if isItemContainer(itemsInBag.itemid) then if doCheckNextBag(itemsInBag,itemTmp,itemQtd) == 1 then return 1 end end return 0 end function doGoTrade(cid,destino) local function fly(params) if isCreature(params.cid) then if isCreature(getCreaturePet(params.cid)) then if params.dd == 3 then --fazer coisas quando chegar na distância correta doTeleportThing(getCreaturePet(params.cid),getThingPos(getPlayerGUIDByName(destino)), true) doPushCreature(getCreaturePet(params.cid), WEST, 1, 0) selfSay(getPetOwner()..' send me to trade with you') selfSay('Say yes to complete the trade') else dir = getDirectionTo(getThingPos(getCreaturePet(params.cid)), getThingPos(getPlayerGUIDByName(destino))) if dir == NORTHWEST then if math.random(1,100) >= 51 then dir = NORTH else dir = WEST end elseif dir == SOUTHWEST then if math.random(1,100) >= 51 then dir = SOUTH else dir = WEST end elseif dir == SOUTHEAST then if math.random(1,100) >= 51 then dir = SOUTH else dir = EAST end elseif dir == NORTHEAST then if math.random(1,100) >= 51 then dir = NORTH else dir = EAST end end local dir = dir if getCreatureSpeed(getCreaturePet(params.cid)) == 0 then doChangeSpeed(getCreaturePet(params.cid), getCreatureBaseSpeed(getCreaturePet(params.cid))) doPushCreature(getCreaturePet(params.cid), dir, 1, 0) doChangeSpeed(getCreaturePet(params.cid), -getCreatureSpeed(getCreaturePet(params.cid))) else doPushCreature(getCreaturePet(params.cid), dir, 1, 0) doChangeSpeed(getCreaturePet(params.cid), -getCreatureSpeed(getCreaturePet(params.cid))) end end end end end local function speed(params) if isCreature(params.cid) then if isCreature(getCreaturePet(params.cid)) then if getCreatureSpeed(getCreaturePet(params.cid)) == 0 then doChangeSpeed(getCreaturePet(params.cid), getCreatureBaseSpeed(getCreaturePet(params.cid))) end end end end doCreatureSay(cid, "Go and back faster than you can!", 1) for i=1,3 do addEvent(fly, 150*i, {cid = cid, dd = i, destino = destino}) addEvent(speed, ((150*3)+100), {cid = cid}) end end function doTrade(cid,petMaster) items = getPlayerStorageValue(petMaster, 15998) itemNo = items:sub(1,5) itemQtd = items:sub(7,9) totalItens = 1 if getPlayerItemCount(cid,itemNo) >= itemQtd then achados = 1 end items = items:sub(11) while items:len() > 0 do itemNo = items:sub(1,5) itemQtd = items:sub(7,9) totalItens = totalItens + 1 if getPlayerItemCount(cid,itemNo) >= itemQtd then achados = achados + 1 end items = items:sub(11) end if achados == totalItens then items = getPlayerStorageValue(petMaster, 15998) itemNo = items:sub(1,5) itemQtd = items:sub(7,9) removeItem = getPlayerItemById(cid, true, itemNo) doRemoveItem(removeItem,itemQtd) items = items:sub(11) while items:len() > 0 do itemNo = items:sub(1,5) itemQtd = items:sub(7,9) removeItem = getPlayerItemById(cid, true, itemNo) doRemoveItem(removeItem,itemQtd) items = items:sub(11) end setPlayerStorageValue(petMaster, 15997, 1) selfSay('Thank you, Bye') doTeleportThing(getCreaturePet(params.cid),getThingPos(petMaster), true) doPushCreature(getCreaturePet(params.cid), WEST, 1, 0) selfSay('Master, say give to have your items') end end function doGiveItems(cid) storage = getPlayerStorageValue(cid, 15997) if storage > 0 then items = getPlayerStorageValue(cid, 15998) itemNo = items:sub(1,5) itemQtd = items:sub(7,9) tradeItem = doCreateItemEx(itemNo,itemQtd) doPlayerAddItemEx(cid, tradeItem, true) items = items:sub(11) while items:len() > 0 do itemNo = items:sub(1,5) itemQtd = items:sub(7,9) tradeItem = doCreateItemEx(itemNo,itemQtd) doPlayerAddItemEx(cid, tradeItem, true) items = items:sub(11) end setPlayerStorageValue(cid, 15997, 0) setPlayerStorageValue(cid, 15998, 0) setPlayerStorageValue(cid, 15999, '') end end end Link para o comentário Compartilhar em outros sites More sharing options...
Step Records 1 Postado Novembro 1, 2018 Autor Share Postado Novembro 1, 2018 Now Kate says hi and it does not work for nothing. He does not even write back Link para o comentário Compartilhar em outros sites More sharing options...
Step Records 1 Postado Novembro 2, 2018 Autor Share Postado Novembro 2, 2018 Now kate not say can help me ? Console: Citar [03/11/2018 00:26:36] [Error - Npc interface] [03/11/2018 00:26:36] data/npc/scripts/Pet.lua:onCreatureSay [03/11/2018 00:26:36] Description: [03/11/2018 00:26:36] data/npc/scripts/Pet.lua:106: attempt to call global 'getPetOwner' (a nil value) [03/11/2018 00:26:37] stack traceback: [03/11/2018 00:26:37] data/npc/scripts/Pet.lua:106: in function <data/npc/scripts/Pet.lua:101> Link para o comentário Compartilhar em outros sites More sharing options...
Step Records 1 Postado Novembro 4, 2018 Autor Share Postado Novembro 4, 2018 Refresh Link para o comentário Compartilhar em outros sites More sharing options...
Marshmello 270 Postado Fevereiro 20, 2019 Share Postado Fevereiro 20, 2019 A questão neste suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta. + Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda. * Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado. Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados