Ao criar o script você testou? Se tiver testado e funcionado não tem necessidade de ter postado aqui.
Arrumar Umas Scripts Minhas *bem Faceis*
Por tonynamoral, 08 de jun. de 2012 em Scripts
info
Grupo: Cavaleiro
Registrado: 19/06/11
Posts: 195
Reputação: +14
Char no Tibia: Desconhecido

info
Grupo: Visconde
Registrado: 21/09/10
Posts: 319
Reputação: +27
Char no Tibia: lest sarif

Não Testei não ! Fiz isso para ter precauçao ! e também aprender com outros scripters
info
Grupo: Visconde
Registrado: 23/02/08
Posts: 273
Reputação: +101
Char no Tibia: Foxx Rookslayer

Se for para task, nao existe o porque colocar uma tabela com a storage, voce pode fazer assim:
function onKill(cid, target)
local monster = {"Dragon", "Orc", "Orc Berserker"}
local tid = table.find(monster, getCreatureName(target))
if tid then
setPlayerStorageValue(cid, 1010 + tid, getPlayerStorageValue(cid, 1010 + tid) < 1 and 1 or getPlayerStorageValue(cid, 1010 + tid)+1)
doPlayerSendTextMessage(cid, 18, "You have killed ".. getPlayerStorageValue(cid, 1010 + tid) .." "..getCreatureName(target).."s.")
end
return true
end
Para terminar o script de task voce pode fazer alguma coisa para determinar o número maximo de monstros, exemplo:
setPlayerStorageValue(cid, 2010 + tid, valor_maximo)
Sendo 2010 o valor base e tid o valor de acordo com o monstro (seguindo a tabela monster)
Assim o script ficaria:
function onKill(cid, target)
local monster = {"Dragon", "Orc", "Orc Berserker"}
local tid = table.find(monster, getCreatureName(target))
if tid then
setPlayerStorageValue(cid, 1010 + tid, getPlayerStorageValue(cid, 1010 + tid) < 1 and 1 or getPlayerStorageValue(cid, 1010 + tid)+1)
if getPlayerStorageValue(cid, 1010+tid) == getPlayerStorageValue(cid, 2010+tid) then
doPlayerSendTextMessage(cid, 18, "Congratulations, you have killed all the ".. getCreatureName(target).."s you needed to complete the task.")
else
doPlayerSendTextMessage(cid, 18, "You have killed ".. getPlayerStorageValue(cid, 1010 + tid) .." / ".. getPlayerStorageValue(cid, 2010 + tid) .." "..getCreatureName(target).."s.")
end
end
return true
end
Editado Junho 8 por Byerne
info
Grupo: Visconde
Registrado: 21/09/10
Posts: 319
Reputação: +27
Char no Tibia: lest sarif

Porém nao é task ! , é um npc de duelo ! so que versao de tibia ! , porisso eu quero ke cada monstro adicione uma storage diferente !


info
Grupo: Visconde
Registrado: 21/09/10
Posts: 319
Reputação: +27
Char no Tibia: lest sarif
Galera , eu gostaria de pedir , para voces darem uma olhada nos scripts que eu fiz e checar se tem erros
se tiver , arrumar para min ! VLW
function onKill(cid,target)[/color] [color=#4E565E]monster = { ["Dragon"] = 1010, ["Orc"] = 1011, ["Orc"] = 1012, ["Orc"] = 1013 } if monster[getCreatureName(target)] then setPlayerStorageValue(cid, monster[getCreatureName(target)], 1) doPlayerSendCancel(cid,You Are Pawned "..getCreatureName(target).."" end[/color] [color=#4E565E]Proximo , agora é 1 NPC
local primeiro = "spider" local segundo = "tarantula" local terceiro = "giant spider" local quarto = "dragon" local quinto = "dragon lord" local level1 = 15 local level2 = 30 local level3 = 50 local level4 = 70 local level5 = 100[/color] [color=#4E565E]local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {}[/color] [color=#4E565E]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[/color] [color=#4E565E]function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end * if msgcontains(msg, 'duel') then selfSay('Você terá 5 desafios, Para Passar por cada um , é so ir falando {frist},{second},{third},{fourth} and {fifth}', cid) return true end[/color] [color=#4E565E]local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid[/color] [color=#4E565E]if msgcontains(msg, 'frist') and getPlayerLevel(cid) >= level1 then selfSay('Este é o Seu Primeiro Desafio.', cid) doCreateMonster(primeiro,getThingPos(cid)) talkState[talkUser] = 1 else selfSay('Você não é Level "..level1.." Para Fazer Essa Quest', cid) return true end if msgcontains(msg, 'second') and getPlayerLevel(cid) >= level2 and getPlayerStorageValue(cid,1010) >= 1 then selfSay('Esse é o seu segundo desafio.', cid) doCreateMonster(segundo,getThingPos(cid)) talkState[talkUser] = 0 elseif getPlayerLevel(cid) < level2 then selfSay('Voce não é level "..level2.." Para Fazer essa quest', cid) elseif getPlayerStorageValue(cid,1010) <= 0 then selfSay('Voce não matou o primeiro monstro', cid) return true end if msgcontains(msg, 'third') and getPlayerLevel(cid) >= level3 and getPlayerStorageValue(cid,1011) >= 1 then selfSay('Esse é o seu terceiro desafio.', cid) doCreateMonster(terceiro,getThingPos(cid)) talkState[talkUser] = 0 elseif getPlayerLevel(cid) < level3 then selfSay('Voce não é level "..level3.." para fazer essa quest', cid) elseif getPlayerStorageValue(cid,1011) <= 0 then selfSay('Voce não matou o segundo monstro', cid) return true end if msgcontains(msg, 'fourth') and getPlayerLevel(cid) >= level4 and getPlayerStorageValue(cid,1012) >= 1 then selfSay('Esse é o seu quarto desafio.', cid) doCreateMonster(quarto,getThingPos(cid)) talkState[talkUser] = 0 elseif getPlayerLevel(cid) < level4 then selfSay('Voce não é level "..level4.." para fazer essa quest', cid) elseif getPlayerStorageValue(cid,1012) <= 0 then selfSay('Voce não matou o terceiro monstro', cid) return true end if msgcontains(msg, 'fifth') and getPlayerLevel(cid) >= level5 and getPlayerStorageValue(cid,1013) >= 1 then selfSay('Esse é o seu ultimo desafio.', cid) doCreateMonster(terceiro,getThingPos(cid)) talkState[talkUser] = 0 elseif getPlayerLevel(cid) < level5 then selfSay('Voce não é level "..level5.." para fazer essa quest', cid) elseif getPlayerStorageValue(cid,1013) <= 0 then selfSay('Voce não matou o quarto monstro', cid) return true end[/color] [color=#4E565E]npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())[/color] [color=#4E565E]Flw
Editado Junho 8 por tonynamoral