PHP:
---locals copied from npc script :)
--keep in mind that names of monsters here must be as same in game so it is "wolf" not "wolves nor Wolf"
-- just edit nams
--["monster name"] = {storage = put unused storage , count = kills for each, rewards = {itemid}
local words = {["wolf"] = {storage = 1234, count = 35, reward = 2466},
["bear"] = {storage = 1235, count = 30, reward = 2446},
["goblin"] = {storage = 1236, count = 20, reward = 2157},
["hunter"] = {storage = 1237, count = 30, reward = 2446},
["rat"] = {storage = 1238, count = 30, reward = 2446}
}
function onKill(cid, target)
if(isPlayer(target) == TRUE) then
return TRUE
end
local monster = words[string.lower(getCreatureName(target))]
if(not monster) then
return TRUE
end
if getPlayerStorageValue(cid,monster.storage) == ((monster.count)-1) then
setPlayerStorageValue(cid,monster.storage, (monster.kills)+1)
doPlayerPopupFYI(cid, " *#Congratulations!#*\n\n\n You have completed the ["..getCreatureName(target).."] quest.\n\n *Go talk to the npc to recieve your reward.")
return true
end
if getPlayerStorageValue(cid,monster.storage) == ((monster.count)+1) then
return true
end
if getPlayerStorageValue(cid,monster.storage) < 0 then
return true
end
setPlayerStorageValue(cid, monster.storage ,(getPlayerStorageValue(cid, monster.storage))+1)
doSendAnimatedText(getPlayerPosition(cid),""..getPlayerStorageValue(cid, monster.storage).."", math.random(01,255))
return true
end
If i kill all monsters the last one stay at 0 hp and without nick and hp bar (freeze).
Anyone can fix this bug ?