felipemko
New Member
- Joined
- Mar 2, 2010
- Messages
- 173
- Reaction score
- 3
Error in Task System, Monster is lifeless however stands and dies.
http://prntscr.com/48jlj3
Script:
http://prntscr.com/48jlj3
Script:
local config = {
['verminor'] = {amount = 2000, storage = 19555, startstorage = 5555, startvalue = 1},
}
function onKill(cid, target)
local monster = config[getCreatureName(target):lower()]
if isPlayer(target) or not monster or isSummon(target) then
return true
end
if getPlayerStorageValue(cid, monster.storage) >= -1 and (getPlayerStorageValue(cid, monster.storage)+1) < monster.amount and getPlayerStorageValue(cid, monster.startstorage) >= monster.startvalue then
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Task: Matou '..(getPlayerStorageValue(cid, monster.storage)+1)..' de '..monster.amount..' '..getCreatureName(target)..'s.')
end
if (getPlayerStorageValue(cid, monster.storage)+1) == monster.amount then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Parabens, voce matou '..(getPlayerStorageValue(cid, monster.storage)+1)..' '..getCreatureName(target)..'s e completou a missao dos '..getCreatureName(target)..'s.')
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
end
return true
end
['verminor'] = {amount = 2000, storage = 19555, startstorage = 5555, startvalue = 1},
}
function onKill(cid, target)
local monster = config[getCreatureName(target):lower()]
if isPlayer(target) or not monster or isSummon(target) then
return true
end
if getPlayerStorageValue(cid, monster.storage) >= -1 and (getPlayerStorageValue(cid, monster.storage)+1) < monster.amount and getPlayerStorageValue(cid, monster.startstorage) >= monster.startvalue then
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Task: Matou '..(getPlayerStorageValue(cid, monster.storage)+1)..' de '..monster.amount..' '..getCreatureName(target)..'s.')
end
if (getPlayerStorageValue(cid, monster.storage)+1) == monster.amount then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Parabens, voce matou '..(getPlayerStorageValue(cid, monster.storage)+1)..' '..getCreatureName(target)..'s e completou a missao dos '..getCreatureName(target)..'s.')
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
end
return true
end