Postado Maio 15, 2016 10 anos Opa! Estou precisando muito alterar esse script, para contar a morte e dar storage para todos que ajudarem a matar o monstro pra fazer tasks em dupla ou mais gente, do jeito que está só 1 ta pegando a storage. MUITO OBRIGADO MESMO! function onKill(player, target, lastHit) if target:isPlayer() or target:getMaster() then return true end local targetName, startedTasks, taskId = target:getName():lower(), player:getStartedTasks() for i = 1, #startedTasks do taskId = startedTasks if isInArray(tasks[taskId].creatures, targetName) then local killAmount = player:getStorageValue(KILLSSTORAGE_BASE + taskId) if killAmount < tasks[taskId].killsRequired then player:setStorageValue(KILLSSTORAGE_BASE + taskId, killAmount + 1) end end end return trueend Editado Maio 15, 2016 10 anos por onix (veja o histórico de edições)
Postado Maio 16, 2016 10 anos tenta tirar a parte do lastHit . deixar function onKill(player, target) vai q da certo kk Se o mundo é mesmo parecido com o que vejo, Prefiro acreditar no mundo do meu jeito. ( - Renato Russo)
Postado Maio 16, 2016 10 anos Se fizer isso, ele vai contar os mostro sumonado também. pelo menos aqui contou até isso. mesmo assim vlw pela dica.
Postado Maio 16, 2016 10 anos function onKill(player, target, cid) if target:isPlayer() or target:getMaster() then return true end local targetName, startedTasks, taskId = target:getName():lower(), player:getStartedTasks() for i = 1, #startedTasks do taskId = startedTasks if isInArray(tasks[taskId].creatures, targetName) then local killAmount = player:getStorageValue(KILLSSTORAGE_BASE + taskId) if killAmount < tasks[taskId].killsRequired then player:setStorageValue(KILLSSTORAGE_BASE + taskId, killAmount + 1) end end end return true end
Postado Maio 18, 2016 10 anos Autor Em 16/05/2016 at 10:28, DukeeH disse: function onKill(player, target, cid) if target:isPlayer() or target:getMaster() then return true end local targetName, startedTasks, taskId = target:getName():lower(), player:getStartedTasks() for i = 1, #startedTasks do taskId = startedTasks if isInArray(tasks[taskId].creatures, targetName) then local killAmount = player:getStorageValue(KILLSSTORAGE_BASE + taskId) if killAmount < tasks[taskId].killsRequired then player:setStorageValue(KILLSSTORAGE_BASE + taskId, killAmount + 1) end end end return true end Obrigado por ajudar amigo @Dukeeh mas deu esse erro: Lua Script Error: [CreatureScript Interface] data/creaturescripts/scripts/quests/killing in the name of/kills.lua:onKill ...escripts/scripts/quests/killing in the name of/kills.lua:8: attempt to index field '?' (a nil value) stack traceback: [C]: in function '__index' ...escripts/scripts/quests/killing in the name of/kills.lua:8: in function <...escripts/scripts/quests/killing in the name of/kills.lua:1>
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.