this script will give items to all player attack monster everytime they kill monster
Code:
local config = {
['demon'] = {amount = 1, storage = 190700}, ----- write name of monster and any empty storage
['dragon'] = {amount = 1, storage = 19001} ---- same here
}
local Reward_boss = {2280,2278,2263,2275,2646,2272,2160} -- put here id of most items to be won
function onKill(cid, target)
local monster = config[getCreatureName(target):lower()]
if isPlayer(target) or not monster or isSummon(target) then
return true
end
local Reward = Reward_boss[math.random(1, #Reward_boss)]
if (getPlayerStorageValue(cid, monster.storage)+1) < monster.amount then
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
end
if (getPlayerStorageValue(cid, monster.storage)+1) == monster.amount then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Congratulations, you have killed '..getCreatureName(target)..' and received '..getItemNameById(Reward)..'.')
doPlayerAddItem(cid, Reward,1)
end
return true
end
this script will give items to all player attack monster but one time only
Code:
local config = {
['demon'] = {amount = 1, storage = 190700}, ----- write name of monster and any empty storage
['dragon'] = {amount = 1, storage = 19001} ---- same here
}
local Reward_boss = {2280,2278,2263,2275,2646,2272,2160} -- put here id of most items to be won
function onKill(cid, target)
local monster = config[getCreatureName(target):lower()]
if isPlayer(target) or not monster or isSummon(target) then
return true
end
local Reward = Reward_boss[math.random(1, #Reward_boss)]
if (getPlayerStorageValue(cid, monster.storage)+1) < monster.amount then
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
end
if (getPlayerStorageValue(cid, monster.storage)+1) == monster.amount then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Congratulations, you have killed '..getCreatureName(target)..' and received '..getItemNameById(Reward)..'.')
doPlayerAddItem(cid, Reward,1)
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
end
return true
end
if u need add outfit to this {when player kill this monster get outfit } u can add somthing like this
['demon'] = {amount = 1, storage = 190700, outfit = {10, 2}},
and
above doPlayerAddItem(cid, Reward,1)
add doPlayerAddOutfitId(cid, monster.outfit[1], monster.outfit[2])
if u need all player get same items when kill monster use this
['demon'] = {amount = 100, storage = 19000, reward = {7791, 1}, outfit = {10, 2}},
and remove
local Reward = Reward_boss[math.random(1, #Reward_boss)]
local Reward_boss = {2280,2278,2263,2275,2646,2272,2160} -- put here id of most items to be won
and change
doPlayerAddItem(cid, Reward,1)
TO doPlayerAddItem(cid, monster.reward[1], monster.reward[2])
i hope u understand me {fucking bad english sorry }