El Man
«لَا إِلَٰهَ إِلَّا ٱللَّٰهُ»
- Joined
- Mar 23, 2013
- Messages
- 161
- Reaction score
- 33
I need kill boss and get loot in my bag
I use this script but ddint work
I use this script but ddint work
Lua:
local config = {
["Royal King "] = {
loot = {{302,100,1},{2157,20,10},{8900,5,1},{5958,10,1},{2471,12,1},{6132,18,1}},
message = "Congratulations for defeating [Boss] Curselich, Your reward is now in your backpack",
BagId = 1988
}
}
--[[
["NameOfMonster"] = {
loot = {{itemid,chance,count},{itemid,chance,count}},
message = "Message produced when you kill the boss",
BagId = dont need explanation
}
]]
function onKill(player, target)
if isPlayer() and target:isMonster() then
local monster = config[Creature(target):getName()]
local bag = doPlayerAddItem(monster.BagId, 1)
if monster then
for i = 1,#monster.loot do
if monster.loot[i][2] >= math.random(1,100) then
doPlayerAddItem(monster.loot[i][1], monster.loot[i][3], INDEX_WHEREEVER, FLAG_NOLIMIT)
end
end
doPlayerSendTextMessage(22, monster.message)
end
end
return true
end