local monsters = {
['Rotworm'] = 4123 -- storage
}
function onKill(cid, target, lastHit)
local check = monsters[getCreatureName(target)]
if isInArray(monsters,getCreatureName(target)) then
setPlayerStorageValue(cid,check,getStorageValue(cid,check)+1)
doPlayerSendTextMessage(cid,27,'You killed '..getPlayerStorageValue(cid,check)..' '..getCreatureName(target)..'s.')
end
return true
end
local monsters = {
['Rotworm'] = 4123 -- storage
}
function onKill(cid, target, lastHit)
local check = monsters[getCreatureName(target)]
if isInArray(monsters,getCreatureName(target)) then
setPlayerStorageValue(cid,check,getStorageValue(cid,check)+1)
doPlayerSendTextMessage(cid,27,'You killed '..getPlayerStorageValue(cid,check)..' '..getCreatureName(target)..'s.')
end
return true
end
3-open creaturescript.xml and pasteregisterCreatureEvent(cid, "teste")
<event type="kill" name="teste" event="script" value="teste.lua"/>
local monsters = {
['rotworm'] = 4123 -- storage, make monstername lowercase.
}
function onKill(cid, target, lastHit)
local check = monsters[getCreatureName(target)lower()]
if isInArray(monsters,getCreatureName(target):lower()) then
setPlayerStorageValue(cid,check,getStorageValue(cid,check)+1)
doPlayerSendTextMessage(cid,27,'You killed '..getPlayerStorageValue(cid,check)..' '..getCreatureName(target)..'s.')
end
return true
end
local monsters = {
['Rotworm'] = 4123 -- storage
}
function onKill(cid, target, lastHit)
local check = monsters[getCreatureName(target)]
if isInArray(monsters,getCreatureName(target)) then
setPlayerStorageValue(cid,check,getStorageValue([B]ci d,[/B]check)+1)
doPlayerSendTextMessage(cid,27,'You killed '..getPlayerStorageValue(cid,check)..' '..getCreatureName(target)..'s.')
end
return true
end
local monsters = {
['rotworm'] = 4123 -- storage, make monstername lowercase.
}
function onKill(cid, target, lastHit)
local check = monsters[getCreatureName(target)lower()]
if isInArray(monsters,getCreatureName(target):lower()) then
setPlayerStorageValue(cid,check,getStorageValue(cid,check)+1)
doPlayerSendTextMessage(cid,27,'You killed '..getPlayerStorageValue(cid,check)..' '..getCreatureName(target)..'s.')
end
return true
end
function onKill(cid, target)--- Script by mock
local s = getPlayerStorageValue(cid,23483)
s = s == -1 and 1 or s
s = tonumber(s) or 1
setPlayerStorageValue(cid,23483,s+1)
addEvent(doPlayerSendTextMessage,100,cid,23,'Você ja matou '..(s+1)..' monstros')
return true
end
local monsters =
{
["rotworm"] = {stor = 4123, text = "You have killed "}
}
function onKill(cid, target, lastHit)
local creature = monsters[getCreatureName(target):lower()]
if not creature then return true end
if getCreatureStorage(cid, creature.stor) < 0 then return doCreatureSetStorage(cid, creature.stor, 0) end
doCreatureSetStorage(cid, creature.stor, getCreatureStorage(cid, creature.stor) + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, creature.text .. getCreatureStorage(cid, creature.stor) .. " " .. getCreatureName(target) .. ".")
return true
end