Well, this is one funny problem.. I really need those scripts, but if I use them players wont be able to kill other players. (they get 0 hp but wont die)
Code:
local monsters = {
--name = storage
["rat"] = 45004,
["cave rat"] = 45004
}
function onKill(cid, target)
if(isPlayer(target) ~= TRUE) then
local name = getCreatureName(target)
local monster = monsters[string.lower(name)]
if(monster) then
local killedMonsters = getPlayerStorageValue(cid, monster)
if(killedMonsters == -1) then
killedMonsters = 1
end
if(name == "rat" or name == "cave rat") and getPlayerStorageValue(cid, 86669) == 2 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed " .. killedMonsters .. " of 10 rat's.")
setPlayerStorageValue(cid, monster, killedMonsters + 1)
if getPlayerStorageValue(cid, 45004)>=10 then
setPlayerStorageValue(cid, 86669, 3)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "rat's.")
end
end
end
return TRUE
end
end
Code:
local monsters = {
--name = storage
["dragon"] = 55004,
["dragon lord"] = 55004
}
function onKill(cid, target)
if(isPlayer(target) ~= TRUE) then
local name = getCreatureName(target)
local monster = monsters[string.lower(name)]
if(monster) then
local killedMonsters = getPlayerStorageValue(cid, monster)
if(killedMonsters == -1) then
killedMonsters = 1
end
if(name == "dragon" or name == "dragon lord") and getPlayerStorageValue(cid, 76669) == 2 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed " .. killedMonsters .. " of 200 dragons.")
setPlayerStorageValue(cid, monster, killedMonsters + 1)
if getPlayerStorageValue(cid, 55004)>=200 then
setPlayerStorageValue(cid, 76669, 3)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed enough dragons.")
end
end
end
return TRUE
end
end