Extrodus
|| Blazera.net ||
So currently when I kill the boss only one person will get the storage. I am trying to make it so everyone that has participated in the fight will get the storage but I am having trouble figuring out which function to use. I assume we would change it from an onKill to onDeath and add a creatureevent to the monster file. But I am just assuming.
Idea from: https://otland.net/threads/add-storage-after-monsters-dead.168892/#post-1633305
Script:
Any help is greatly appreciated!
Idea from: https://otland.net/threads/add-storage-after-monsters-dead.168892/#post-1633305
Script:
Code:
local storage = 3100 -- storageID to use.
local maxPoints = 1 -- maximum amount of saved points a player can have
local givePoints = 1 -- amount of points to give player
local creatureName = '[b] willow' -- creaturename (must be lowercase letters)
function onKill(player, target, damage, flags)
if target:isPlayer() then
return true
end
local name = target:getName():lower()
if name ~= creatureName then
return true
end
if player:getStorageValue(storage) < 0 then
player:setStorageValue(storage, 0)
end
if player:getStorageValue(storage) < maxPoints then
player:setStorageValue(storage, player:getStorageValue(storage) + givePoints)
end
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have defeated ' .. name .. '.')
return true
end
Any help is greatly appreciated!