Hihio!
This script is to count the number of monsters killed, write them on the items and when they are killed like 1,000 demons gets reward.
PART Creaturescript
First go to Creaturescript.xml
Second open Login lua
Next create count.lua
PART ACTIONS
First go to actions.xml
Second go to actions/scripts/ create countitem.lua
Sorry for my bad English
Repp+
This script is to count the number of monsters killed, write them on the items and when they are killed like 1,000 demons gets reward.
PART Creaturescript
First go to Creaturescript.xml
Code:
<event type="kill" name="countKill" event="script" value="count.lua"/>
Second open Login lua
Code:
registerCreatureEvent(cid, "countKill")
Next create count.lua
Code:
local monsters = {
["demon"] = 9545,
}
function onKill(cid, target)
if(isPlayer(target) ~= true and isPlayer(cid)) then
local name = getCreatureName(target)
local monster = monsters[string.lower(name)]
if(monster) then
local killedMonsters = getPlayerStorageValue(cid, monster)
if(killedMonsters < 1000) then
killedMonsters = 1
end
end
return true
end
PART ACTIONS
First go to actions.xml
Code:
<action actionid="XXXX" event="script" value="countitem.lua"/>
Second go to actions/scripts/ create countitem.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local monster = monsters[string.lower(name)]
if(monster) then
local killedMonsters = getPlayerStorageValue(cid, monster)
if item.itemid == xxxx then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed " .. killedMonsters .. " " .. name .. "'s.")
elseif(killedMonsters == 1000) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Gratulacje zabiles 1000 " .. name .. "'s.")
doPlayerAddMoney(cid, 20000) == TRUE then
doPlayerSendTextMessage(cid, 19,"Dostales nagrode!")
doSendMagicEffect(getPlayerPosition(cid), 27)
end
end
return true
end
Sorry for my bad English
Repp+