Postado Agosto 27, 2021 3 anos Autor Ñ FUNCIONO EU FALA HI DAS AS OPÇOES MAIS CONTINUA MUDO NAO DA AS RESPSOTA DE RESET QUANTY VAMO VE ESSE DAI ESSE É SÓ O '&' MAIS EU NAO SEI COMO MEXER LINE:37
Postado Agosto 27, 2021 3 anos troca if resets < 0 then por if resets < 0 then Editado Agosto 27, 2021 3 anos por Rogex Joyz (veja o histórico de edições)
Postado Agosto 27, 2021 3 anos Autor [27/08/2021 01:11:25] [Error - LuaScriptInterface::loadFile] data/npc/scripts/reseter.lua:91: 'then' expected near '&' [27/08/2021 01:11:25] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/reseter.lua [27/08/2021 01:11:25] data/npc/scripts/reseter.lua:91: 'then' expected near '&'
Postado Agosto 27, 2021 3 anos Troque if getResets(cid) < maxResets then por if getResets(cid) < maxResets then
Postado Agosto 27, 2021 3 anos Autor DA ESSE ERRO NO CONSOLE [27/08/2021 01:23:33] [Error - LuaScriptInterface::loadFile] data/npc/scripts/reseter.lua:105: 'then' expected near '&' [27/08/2021 01:23:33] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/reseter.lua [27/08/2021 01:23:33] data/npc/scripts/reseter.lua:105: 'then' expected near '&' [27/08/2021 01:23:38] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/resete.xml). [27/08/2021 01:23:38] Info: failed to load external entity "data/npc/resete.xml" O SCRIPT TA ASSIM: SÓ FIZ OQUE VOCE MANDO. -- config local minlevel = 50 -- level inical para resetar local price = 1000 -- preço inicial para resetar local newlevel = 8 -- level após reset local newexp = 4200 -- nova experiencia após reset local lvlByReset = 50 -- level acrescentado por reset local priceByReset = 100 -- preço acrescentado por reset local maxResets = 100 -- máximo de resets -- end config function addReset(cid) resets = getResets(cid) setPlayerStorageValue(cid,1020,resets+1) return true end function getResets(cid) resets = getPlayerStorageValue(cid,1020) if resets < 0 then resets = 0 end return resets end 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 local needlvl = minlevel + (getResets(cid) * lvlByReset) local newPrice = price + (getResets(cid) * priceByReset) if msgcontains(msg, 'resetar') then if getResets(cid) < maxResets then selfSay('Voce deseja reset seu char? Isto custará '..newPrice..' gp\'s!', cid) talkState[talkUser] = 1 else selfSay('Você ja alcançou seu limite de resets!', cid) end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerMoney(cid) < newPrice then selfSay('É Necessario ter '..newPrice..' gp\'s para resetar!', cid) elseif getPlayerLevel(cid) < needlvl then selfSay('O level minimo para reset é '..needlvl..'!', cid) else doPlayerRemoveMoney(cid,newPrice) if isInArray(vocs, getPlayerVocation(cid)) then doPlayerSetVocation(cid, getPlayerVocation(cid)+4) end addReset(cid) playerid = getPlayerGUID(cid) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level`="..newlevel..",`experience`="..newexp.." WHERE `players`.`id`= ".. playerid .."") end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then talkState[talkUser] = 0 selfSay('Ok.', cid) elseif msgcontains(msg, 'quant') then selfSay('Voce tem um total de '..getResets(cid)..' reset(s).', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.