eluna-scripts-isidorsson/DropLootOnKillArea.lua

26 lines
819 B
Lua
Raw Permalink Normal View History

2020-11-20 11:36:57 +01:00
--[[ Helped a person to fix this.]]
local npcid = 17259
local chance = 0.30
local DropSolo = {51800, 51803, 50793, 51011, 51384, 51788}
math.randomseed(os.time()) --If you want a different sequence of random numbers, then pass this. os.time() will return the time in number of seconds so it will be different every time.
function BonechewerHungerer(event, creature, killer)
local item, range, isHostile, isDead = 12345, 50, 0, 0
local players = creature:GetPlayersInRange(range, isHostile, isDead)
if (players) then
for _, player in pairs(players) do
for _, v in pairs(DropSolo) do
if (math.random() < chance) then
player:AddItem(v)
end
end
end
end
end
2020-11-20 11:36:57 +01:00
RegisterCreatureEvent(npcid, 4, BonechewerHungerer)