local Config = {
Monsters = {
-- ["Name"] = {amount = quantidade}
["Demon"] = {amount = 5},
["Hydra"] = {amount = 10},
},
StoragePro = 54661, -- Não mexer se não souber editar
Money = 100 -- Dinheiro
}
function onKill(cid, target)
if not isMonster(target) and getPlayerStorageValue(cid, Config.StoragePro) >= (2 + #Config.StoragePro) then
return false
end
local monster = Config.Monsters[getCreatureName(target):lower]
if monster then
local sto = getPlayerStorageValue(cid, monster)
if sto < (monster.amount - 1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Task message: [" .. (sto + 1) .. "/" .. monster.amount .. "] of " .. getCreatureName(target) .. ".")
setPlayerStorageValue(cid, monster, (sto + 1))
elseif sto == (monster.amount - 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations!! you have killed" .. (sto + 1) .. "/" .. monster.amount .. "] of " .. getCreatureName(target) .. "s ands and completed the task.")
setPlayerStorageValue(cid, monster, (sto + 1))
setPlayerStorageValue(cid, Config.StoragePro, (getPlayerStorageValue(cid, Config.StoragePro) + 1))
end
end
return true
end
function onLogin(cid)
registerCreatureEvent('taskNpc')
return true
end
não se esqueça em registra o script no login.lua






info
Grupo: Visconde
Registrado: 26/08/10
Posts: 431
Reputação: +60
Gênero: Masculino
Char no Tibia: Gabriel Rookgaardian
Estou com um script de segunda promotion, é um script que está associado a um de segunda promotion, que se consegue fazendo essa task com o NPC., mas está dando um erro nesse script que é pra colocar em criaturescript, segue ele:
local Config = { Monsters = { -- ["Name"] = {amount = quantidade} ["Demon"] = {amount = 5}, ["Hydra"] = {amount = 10}, }, StoragePro = 54661, -- Não mexer se não souber editar Money = 100 -- Dinheiro } function onKill(cid, target) if not isMonster(target) and getPlayerStorageValue(cid, Config.StoragePro) >= (2 + #Config.StoragePro) then return false end local monster = Config.Monsters[getCreatureName(target):lower] if monster then local sto = getPlayerStorageValue(cid, monster) if sto < (monster.amount - 1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Task message: [" .. (sto + 1) .. "/" .. monster.amount .. "] of " .. getCreatureName(target) .. ".") setPlayerStorageValue(cid, monster, (sto + 1)) elseif sto == (monster.amount - 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations!! you have killed" .. (sto + 1) .. "/" .. monster.amount .. "] of " .. getCreatureName(target) .. "s ands and completed the task.") setPlayerStorageValue(cid, monster, (sto + 1)) setPlayerStorageValue(cid, Config.StoragePro, (getPlayerStorageValue(cid, Config.StoragePro) + 1)) end end return true end function onLogin(cid) registerCreatureEvent('taskNpc') return true endO erro é esse : input:14: function arguments expected near ']' , nessa linha: local monster = Config.Monsters[getCreatureName(target):lower]
Editado Agosto 3 por gabrielvs